• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JDBC in applets

 
Meng Tan
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.
 
Sean Casey
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.
 
Alan Watts
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic