How do I determine JDBC Version? - oracle.jdbc.driver
843854Aug 4 2003 — edited Jan 7 2006The 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());