Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Using JDBC in applets

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I tried using the following statement in an applet and it gives a ClassNotFoundException:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
Can somebody please explain to me why???
It seems like the applet cannot find the Sun's driver package.
Pleas help.
 
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the driver referenced in your classpath?
 
Meng Tan
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem occured when I run the applet using IE.
How do u put the driver in the classpath during execution?
I thought the Sun's ODBC bridge driver is in JDK 's standard library.
Please advise.
 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not using windows. I'm using linux, and the .jar that the driver is in needs to be directly referenced in my classpath.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meng,
Assuming that you have the bridge already referenced in the classpath (Perhaps due to it being in the same directory as the standard java classes), then perhaps the problem you have is related to your attempts to use the applet on a network? The Sun bridge is a fairly simple type I driver, and as I understand it cannot be used on a network?
Cheers
Alan Watts
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic