Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I determine JDBC Version? - oracle.jdbc.driver

843854Aug 4 2003 — edited Jan 7 2006
The following is my path and classpath and script.


Path = D:\oracle\ora90\bin;
D:\oracle\ora90\Apache\Perl\5.00503\bin\mswin32-x86;
C:\Program Files\Oracle\jre\1.1.8\bin;
%SystemRoot%\system32;
%SystemRoot%;
%SystemRoot%\System32\Wbem;
C:\Program Files\Common Files\AdaptecShared\System;
C:\Program Files\Java\j2re1.4.2\bin;
D:\oracle\ora90\LIB


classpath = .;
C:\Program Files\Java\j2re1.4.2\bin;
D:\oracle\ora90\jdbc\lib\


JDBCVersion.java

import java.sql.*;
import oracle.jdbc.driver.*;
class JDBCVersion
{
public static void main (String args[])
throws SQLException
{

//DriverManager.registerDriver
//(new oracle.jdbc.driver.OracleDriver());

// Load the Oracle JDBC driver
DriverManager.registerDriver
(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:scott/tiger@t3100:1521:oracle");
// Create Oracle DatabaseMetaData object
DatabaseMetaData meta = conn.getMetaData();
// gets driver info:
System.out.println("JDBC driver version is " + meta.getDriverVersion());
}
}

this throws the following:
D:\oracle\ora90\jdbc\demo\samples\thin\basic\JDBCVersion.java:2: package oracle.jdbc.driver does not exist
import oracle.jdbc.driver.*;
^
D:\oracle\ora90\jdbc\demo\samples\thin\basic\JDBCVersion.java:14: package oracle.jdbc.driver does not exist
(new oracle.jdbc.driver.OracleDriver());









Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2006
Added on Aug 4 2003
8 comments
702 views