niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle » Server
Setting the jdbc classpath variable for 10g on Java 1.4.2 ( Windows XP Pro )
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Rauf Sarwar
*nix forums Guru


Joined: 03 May 2005
Posts: 353

PostPosted: Fri Feb 11, 2005 12:04 pm    Post subject: Re: Setting the jdbc classpath variable for 10g on Java 1.4.2 ( Windows XP Pro ) Reply with quote

Jean-Benoit MORLA wrote:
Quote:
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@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@tiscali.fr

Must be something with your classpath or jdk version. I tested your
code on an XP SP1. I am using jdk 1.4.2_02. Here is the screen dump,

C:\JavaDev\test\test>set classpath
CLASSPATH=.;C:\oracle\ora101\jdbc\lib\ojdbc14.jar;C:\oracle\ora101\jdbc\lib\nls_charset12.jar;C:\oracle\ora92\jdbc\
lib\ojdbc14.jar;C:\oracle\ora92\jdbc\lib\nls_charset12.jar;C:\j2sdk1.4.2_02\jre\lib\rt.jar;C:\j2sdk1.4.2_02\jre\lib\c
harsets.jar;C:\j2sdk1.4.2_02\jre\lib\jce.jar;C:\j2sdk1.4.2_02\jre\lib\jsse.jar;C:\j2sdk1.4.2_02\jre\lib\plugin.jar;C:
\j2sdk1.4.2_02\jre\lib\sunrsasign.jar

C:\JavaDev\test\test>javac Test.java

C:\JavaDev\test\test>java Test
JDBC driver version is 10.1.0.2.0

C:\JavaDev\test\test>

Regards
/Rauf
Back to top
Jean-Benoit MORLA
*nix forums beginner


Joined: 11 Feb 2005
Posts: 4

PostPosted: Fri Feb 11, 2005 9:28 am    Post subject: Setting the jdbc classpath variable for 10g on Java 1.4.2 ( Windows XP Pro ) Reply with quote

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@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@tiscali.fr
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 1:57 am | All times are GMT
navigation Forum index » Databases » Oracle » Server
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before... Shaguf Apache 0 Tue Dec 23, 2008 7:41 am
No new posts Postfix + MySQL error: very strange variable %s iWarior Postfix 0 Mon Aug 25, 2008 2:01 pm
No new posts User Environment - export PATH variable paalepu AIX 0 Tue Sep 12, 2006 8:12 pm
No new posts problem with windows installer Christian Rengstl PostgreSQL 0 Fri Jul 21, 2006 10:55 am
No new posts question for JAVA developer who r using postgres sql as b... deepak pal PostgreSQL 1 Fri Jul 21, 2006 9:00 am

Loans | Car Loan | Credit Card Consolidation | Lingerie | Myspace Images
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.4085s ][ Queries: 20 (0.1764s) ][ GZIP on - Debug on ]