Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Problems with JDBC

Re: Problems with JDBC

From: Avi Abrami <aabrami_at_intersystemsww.com>
Date: Wed, 26 Feb 2003 14:15:46 +0200
Message-ID: <3E5CAFF2.4030609@intersystemsww.com>


Rauf Sarwar wrote:

> Michael Gruetzner <Michael_Gruetzner_at_gmx.de> wrote in message news:<3E59CAE3.3090105_at_gmx.de>...
> 

>>Hello,
>>
>>I try to make a jdbc connection to an Oracle 9iR2.
>>In my Java programm I use the following lines to
>>connect:
>>DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
>> Connection conn =
>>DriverManager.getConnection("jdbc:oracle:thin:myuser/mypass_at_localhost:1521:mydb");
>>
>>When I run my Program I always get this exception:
>>
>>Exception in thread "main" java.lang.NoClassDefFoundError:
>>java/sql/Savepoint
>> at java.lang.ClassLoader.defineClass0(Native Method)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
>> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
>> at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
>> at
>>oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
>> at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
>> at java.sql.DriverManager.getConnection(DriverManager.java:517)
>> at java.sql.DriverManager.getConnection(DriverManager.java:177)
>> at mypackage1.Class1.<init>(Class1.java:13)
>> at mypackage1.Class1.main(Class1.java:23)
>>
>>I also tried to create a database connection with JDeveloper an I
>>entered the same connection string as above. When I Test the connection
>>I get "Success", so I think the String is ok. The DB is also up and running.
>>
>>I hope, someone can help me.
>>Thank you in advance...Michael
> 
> 
> 
> Build your connection url like this and then try again,
> 
> ("jdbc:oracle:thin:@localhost:1521:mydb", "myuser", "mypass");
> 
> Regards
> /Rauf Sarwar

Rauf,
Excuse me, but I don't understand. The error message that Michael has posted states that the JVM cannot find the "java.sql.Savepoint" class. What has this to do with the connection URL that Michael is using?

[In any case, he said it works in JDeveloper]

According to the java documentation (javadoc) for J2SE version 1.4.1, the "Savepoint" class is new (since version 1.4). Hence my guess is that Michael is using a JDBC driver (or JRE) that is not compliant with version 1.4

Since Michael has provided a miniscule amount of information regarding his environment, I will not hazard a guess as to how he can resolve his problem.

[Hopefully, he should be able to figure it out for himself from here :-]

Good Luck (to all of you),
Avi. Received on Wed Feb 26 2003 - 06:15:46 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US