I just started learning JDBC and I have Oracle 8.1.7 and JDK1.3.1 installed on my computer. This is my autoexec.bat: set path=c:\jdk1.3.1\bin;c:\oracle\ora81\bin;c:\oracle\ora81\jdbc\lib; set classpath=c:\oracle\ora81\jdbc\lib\classes12.zip;c:\oracle\ora81\jdbc\lib\nls_charset12.zip 1. is this the correct setting ? the documentation said that classes12.zip is dedicated for jdk1.2 is there a specific oracle.jdbc.driver for jdk1.3? When I was installing oracle 8.1.7 ( downloaded from oracle site) I was asked to enter the database name, and I entered "Oracle" and the suggested SID is also "Oracle" so the database (host:port:sid) for connection is: @localhost:1521:Oracle or @127.0.0.1:1521:Oracle is this correct, since I keep getting error messages? Please somebody help me. Thanks (Edited by Dave to fix the smilie problems) [ January 03, 2002: Message edited by: David O'Meara ]
Stanley I currently use Windows 98 second Ed. Here is the error message: Error Messages: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323) at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:263) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260) at java.sql.DriverManager.getConnection(DriverManager.java:517) at java.sql.DriverManager.getConnection(DriverManager.java:177) at JDBCVersion.main(JDBCVersion.java:10) But it works fine if I use OCI8 instead of thin driver ( "jdbc:oracle:oci8:@","scott","tiger") Thanks ( Edited by Dave to fix the :o ) [ January 03, 2002: Message edited by: David O'Meara ]
BTW, what's your connection string? It should be something like: conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "username", "password"); [ January 04, 2002: Message edited by: Stanley Tan ] (Edited by Dave to remove try :o instead) [ February 21, 2002: Message edited by: David O'Meara ]
I have tried all combination of connection string: ("jdbc:oracle:thin:@localhost:1521:oracle",user,pwd); ("jdbc:oracle:thin:@localhost:1521:orcl",user,pwd); ("jdbc:oracle:thin:@mycom:1521:orcl",user,pwd); ("jdbc:oracle:thin:@mycom:1521:oracle",user,pwd); // where "mycom" is my computer name (Edited by Dave to remove try :o instead) [ February 21, 2002: Message edited by: David O'Meara ]
I am on Windows XP so I am able to start and stop listeners. Check your Oracle documentation on how to do this for Windows 98. You want to start a TNS listener. Sorry I am not of much help. Or perhaps you could just use the JDBC ODBC driver for now.
Just figured this one out. Had the exact problem - could connect using the oci driver but not the thin client. Real problem is that the listener has not been started. Solution (on linux) is to go into the "lsnrctl" commandline utility and enter "start". Does anyone know how to automatically start the listener services on a unix box when the server starts? Much appreciated.