• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applets and MySQL

 
Dale Bradley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, im a new member here although i have been lurking for a few years!

I just realised that i originally posted in the wrong forum section, so sorry.

My problem:

I have created a java applet which is linked to a database in MySQL. It queries and updated the tables within depending on user interaction.
My applet runs fine from within Eclipse but i seem to be running into a similar problem to many others. I have looked over MANY threads on this problem but have yet to find a definitive answer/solution. They all seem to differ. I have picked up information from these threads but i am still a bit confused. When i open my applet through a html file nothing happens, no error messages, nothing. I have commented out my code and just painted a line of text and it works, so i dont believe its my html file thats the issue. What i would like to know from you gurus is:

1. Do i have to create a jar (i have tried this but is it necessary?)
2. Do i have to get my applet signed to enable the database interaction whilst running in a browser?
3. Could there be another reason why my applet will not load?

The GUI is displayed but nothing is pulled from my database.

This is extremely frustrating! It will eventually be placed on a server along with the database.

I can post the code if required, although it has quite a high amount of lines. Any help would be GREATLY appreciated!
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Open the Java console and look at the stack trace. It will tell you the core problem. Here's some info on how to enable the console

 
Dale Bradley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah thanks a lot for that!

So, my error is that it cannot find the MySQL driver. I have added the jar to the jdk so im not sure what it could be. I will continue to look for a solution.

Thanks a lot for that tip, i was under the impression that the console in Chrome would supply me with that info, but clearly i was wrong!

 
Tim Moores
Bartender
Posts: 2946
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to add the driver jar to the applet tag's archive attribute, and distribute it with the applet. The easiest is probably in the same directory as the HTML file.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dale, I have to ask my perennial question of folks posting here to the Applet forum: Why in the world are you using an Applet in 2012?

Applets were cool technology in 1997. They stopped being cool in 1998.

Modern solutions use the user's browser with some javascript talking to a web service (often written in Java using servlets).

What makes you want to try applets?
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps the Applet doesn't have the proper security permission to create a network connection to the database?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic