| Author |
New to jdbc,please help
|
Metelda Ganugapanta
Greenhorn
Joined: Jul 10, 2003
Posts: 12
|
|
Hi I am new to jdbc. I have Orale9.2.0.1 and jdk1.4.0 installed on my Windows XP machine. I want to install a driver from the following website. http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html There are 3 files to be downloaded. ojdbc14.jar ojdbc14_g.jar ocrs12.zip. I have not downloaded them yet. Am I doing correctly? Is this a java Thin Driver that I am downloading ? Is this JDBC2.0 or JDBC3.0 ?How would I know ? Thanks Metelda
|
 |
Jamie Robertson
Ranch Hand
Joined: Jul 09, 2001
Posts: 1879
|
|
From the link you provided all of the following are THIN drivers: For use with JDK 1.4 (JDBC 3.0 compatible) ojdbc14.jar - JDBC classes (1,181,679 bytes) - all JDBC 3.0 spec classes - this is generally the one you need ojdbc14_g.jar - JDBC classes with debug and trace(1,391,860 bytes) - all JDBC 3.0 spec classes and some extra utilities ocrs12.zip - Additional RowSet support (36,764 bytes) - separate RowSet Implementation - don't need it For use with JDK 1.2 and JDK 1.3 (JDBC 2.0 compatible) classes12.zip - JDBC classes (1,213,897 bytes) - all JDBC 2.0 spec classes - this is generally the one you need if you want JDBC 2.0 implementation classes12_g.zip - JDBC classes with debug and trace (1,451,562 bytes) - all JDBC 2.0 spec classes and some extra utilities classes12dms.jar - JDBC classes for use with Enterprise Manager (1,208,920 bytes) classes12dms_g.jar - JDBC classes for use with EM and with debug and trace (1,446,753 bytes) ocrs12.zip - Additional RowSet support (36,764 bytes) nls_charset12.zip - Additional National Language character set support (1,813,731 bytes) The skinny: at this point all you should need is ojdbc14.jar Jamie [ October 30, 2003: Message edited by: Jamie Robertson ]
|
 |
Jamie Robertson
Ranch Hand
Joined: Jul 09, 2001
Posts: 1879
|
|
|
another link you might need is Oracle9i JDBC Developer's Guide and Reference
|
 |
Metelda Ganugapanta
Greenhorn
Joined: Jul 10, 2003
Posts: 12
|
|
Hello Jamie Thanks very much for your reply. So,all I have to download is "ojdbc14.jar" . Thanks for the additional link you provided. Metelda
|
 |
Metelda Ganugapanta
Greenhorn
Joined: Jul 10, 2003
Posts: 12
|
|
Hi all I have followed the above link "Oracle 9i JDBC Developer's Guide and Reference " I have not downloaded the file "ojdbc14.jar" since it is already in the "oracle9201\jdbc\lib". Now I am trying to find out the DriverVersion. I am compiling this file 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 racle:thin:@localhost:2030:mary","scott","tiger"); // Create Oracle DatabaseMetaData object DatabaseMetaData meta = conn.getMetaData(); // gets driver info: System.out.println("JDBC driver version is"+ meta.getDriverVersion()); I am getting an error package "oracle.jdbc.driver.*;" does not exist. Also I am not sure about the port number and SID.That was the number I noted down when I downloaded Oracle. Can anyboby please help me ? Thanks Metelda
|
 |
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8265
|
|
Originally posted by Metelda Ganugapanta: package "oracle.jdbc.driver.*;" does not exist.
Do you have the ojdbc jar file in your classpath?
Also I am not sure about the port number and SID.That was the number I noted down when I downloaded Oracle.
I think the default port number for Oracle is 1521. Of course, your installation may vary. As for SID, you configure that when you set up the database (should be at the same time you specified a database name).
|
"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
|
 |
Metelda Ganugapanta
Greenhorn
Joined: Jul 10, 2003
Posts: 12
|
|
Hi Joe Thanks for your help. I have set the classpath and changed the port number too. It is working now. Metelda
|
 |
 |
|
|
subject: New to jdbc,please help
|
|
|