• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applets and MySQL

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps the Applet doesn't have the proper security permission to create a network connection to the database?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic