Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jdbcodbc works in main but not in applet

Status
Not open for further replies.

javaarray

Programmer
Feb 10, 2001
17
0
0
US
I am trying to create tables in a applet and it keeps throwing the following error ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
SQLException: No suitable driver

But if I run the same program as a main it works fine. I am developing in visual age for java 3.5 Entry entrprise. If I put the applet on my NT machine at work which also is running visual age for java it runs also.

Any ideas??
 
Sounds like a classpath issue. Make sure that rt.jar is in your system classpath.
 
My first guess is that this is a CLASSPATH error. VisualAge overrides the System CLASSPATH, so that is why I am guessing it works. Check your CLASSPATH and see that it has all the neccessary libraries.

I think all you need is [jdk-directory]/lib and . in the CLASSPATH. Wushutwist
 
Hey

Please include ur driver class file into your applet using archive tags.
Then use the connection object to establishth the connection.

If u have webserver and database seperately the u need signed applet . If u have in the same machine.
Then u can connect using the browser not using the appletviewer.


Shyam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top