• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making JDBC connection from Swing

 
Suresh Kanagalingam
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a swing component that connects to Oracle to fetch data. When I run this as an application it works fine. I am able to connect to the dB and get the data.
But when I convert this to applet, I am getting "oracle/jdbc/driver/OracleDriver" class not found error. I do have this in my classpath and I was able to compile the code properly.
Can anyone help me on this please?
Thanks
Suresh
 
kyle amburn
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check your codebase property of your html. The applet will look for classes in this url not necessarily in your classpath.
Kyle
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keep in mind that applets are only allowed to connect back to the same server from which they originated. So if you are trying to connect to a database, the database and web server must be on the same machine. In most *real* production environments the database server and web server are different machines.
You won't notice this behavior in the "appletrunner", and there are ways of configuring applets to request access to other resources. Just keep in mind that you may have to do additional work to get your applet to talk to a database.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic