This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Making JDBC connection from Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Making JDBC connection from Swing" Watch "Making JDBC connection from Swing" New topic
Author

Making JDBC connection from Swing

Suresh Kanagalingam
Ranch Hand

Joined: Aug 17, 2001
Posts: 82
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

Joined: Jul 29, 2001
Posts: 64
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

Joined: Sep 03, 2003
Posts: 399
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.
 
Consider Paul's rocket mass heater.
 
subject: Making JDBC connection from Swing
 
Similar Threads
updating a Long column in Oracle thru JDBC deployed on a Weblogic 6.1 Server
help needed
exclusive lock
running from .jar file has missing classes
How to retrive long data Types of oracle in java