Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Setting the jdbc classpath variable for 10g on Java 1.4.2 ( Windows XP Pro )
Hi
I'm trying to compile this source from Oracle JDBC manuel:
// JDBCVersion.java
// get the Jdbc version from the database connexion
import java.sql.*;
import oracle.jdbc.*;
import oracle.jdbc.pool.OracleDataSource;
class JDBCVersion{
public static void main (String args[]) throws SQLException { OracleDataSource ods = new OracleDataSource(); ods.setURL("jdbc:oracle:thin:scott/tiger_at_host:port/service"); Connection conn = ods.getConnection(); // Create Oracle DatabaseMetaData object DatabaseMetaData meta = conn.getMetaData(); // gets driver info: System.out.println("JDBC driver version is " + meta.getDriverVersion()); }
}
I get the compiler errors:
Package jdbc does not exist
Package jdbc.pool does not exist.
I have set the CLASSPATH variable to:
ORACLE_HOME\jdbc\lib\ojdbc14.jar;ORACLE_HOME\jdbc\lib\orai18n.jar
as stated in page 2-3 from the Oracle JDBC manual.
My java install is in
f:\j2sdk_1_4_2_04
I put this directory first in the PATH variable to avoid the Oracle
java compiler which is older.
Maybe I need other more recent jdbc jar files for this version of
Java?
Many thanks for your reply.
jbmorla_at_tiscali.fr
Received on Fri Feb 11 2005 - 04:28:49 CST
![]() |
![]() |