This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
hi, i am thiru, i am unable to connect jdbc with oracle 8i. can anyone help to do above mentioned problem.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
hi, u can connect to Oracle through the JDBC-odbc bridge driver. if u can connect to oracle from VB for example. u can connect useing the same dsn name. rahul
You need to get the current driver for your 8i database from Oracle (free download) and set your classpath to point to the classes111.zip (it's the same name for each version of Oracle but, won't reliably work with different versions) I personnally like the thin drivers instead of the OCI. Then to connect it's try { //register the driver DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); // Get database connection. Connection conn = DriverManager.getConnection(databaseURL, userName, password);
I tried exactly the same way as you said and when compiled with 'javac -classpath c:\oracle\ora81\jdbc\lib\classes111.zip myfile.java' there was no error. But when I run it with 'java myfile ' I get the error NoClassDefFound Error: oracle/jdbc/driver/OracleDriver. What am I doing wrong.Please help
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
You only included the classes111.zip file in the CLASSPATH when you compiled the program. You also need to include it when you run the program.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
To Setup Oracle JDBC driverWin95/Win98/NT. setLASSPATH=[oracle_home]\jdbc\lib\classes111.zip,[oracle_home]\jdbc\lib\nls_claset111.zip, %CLASSPATH% (or) setLASSPATH=[oracle_home]\jdbc\lib\classes12.zip,[oracle_home]\jdbc\lib\nls_claset12.zip, %CLASSPATH% import oracle.sql.*; import oracle.jdbc.drivers.*; Hope this helps, monty6
[This message has been edited by monty6 (edited August 02, 2000).]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.