Reputation: 77
I'm working in Netbeans, developing a Java Applet, as well as a few simple HTML pages that take the form of a Netbeans Web Application. I make a MySQL database connection within the code of my applet. This has been working fine for about a day now (I added the necessary .jar) and I have seen changes in the database as a result of testing, both when I attempt to run the applet straight from Netbeans, and when I run the web application from Netbeans and use the applet embedded in my HTML. However, I recently have been getting a ClassNotFoundException after calling the line:
Class.forName("com.mysql.jdbc.Driver");
in my applet code via the Web Application. Note that this line still executes successfully when I run the applet and not the web application. Only accessing the applet in Firefox is giving me these troubles. I tried restarting Netbeans and Firefox, and still no luck.
I apologize for the vagueness of the question, I was just hoping someone else might have experienced this and would know what to do. I'm pretty sure I haven't changed any code that is related to this Exception (given that the Applet still runs smoothly when not HTML-embedded), so that's all the relevant information I can think to give.
Upvotes: 0
Views: 505
Reputation: 1745
You need to let applet know about library with jdbc driver. Here is how to do it: Adding a Third Party Library to Java Applet
Upvotes: 1