Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> new to jdbc-oracle

new to jdbc-oracle

From: Rob Zwartjes <rzwartje_at_rob.home.nl>
Date: 10 Dec 2001 22:45:36 GMT
Message-ID: <slrna1ad2l.ci9.rzwartje@home.rob.nl>

Hai,
I have installed oracle 8.1.6 on linux ( SuSE 7.2) and have trouble running the script below :

import java.sql.*;
import oracle.jdbc.driver.*;

class JDBCVersion
{

	public static void main (String args[]) throws SQLException
	{

// Load the Oracle JDBC driver
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@home:1521:TEST","name","passw");
// Create Oracle databaseMetaData object
DatabaseMetaData meta = conn.getMetaData();
// get drivers info:
System.out.print("JDBC driver version is " + meta.getDriverVersion()); }

}
This little script comes from oracle doc A81354-01.pdf. After running : javac GetDriverVersion.java ( name of the script above ), chmod u+x GetDriverVersion.java ( to make it a exe ) and typed GetDriverVersion.java to run it.
The only thing I get is a fat cross in my console window. Nothing else. The values after the @ sign I retrieved from tnsnames.ora because I didn't know what else to fill in for host, port and sid. Changing thin to oci8 and putting after the @ sign TEST.ROB.NL ( from tnsnames.ora) didn't solve my problem. Classpath has been set btw. And for the oci8 the LD_LIBRARY_PATH
What am I forgetting ????? or overlooking ???

Thanks in advance for your time,

Rob Received on Mon Dec 10 2001 - 16:45:36 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US