my dog learned polymorphism*
The moose likes Applets and the fly likes Applet - Package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet - Package" Watch "Applet - Package" New topic
Author

Applet - Package

srihari miriyala
Greenhorn

Joined: May 16, 2012
Posts: 16
hi guys, i am newbie, i have following code

AppletOne.java




and

a package




while running in a eclipse, i got the data from mySQL database.. but in through command prompt i am getting following error


and




and my html page look like



i 've windows7 OS and 've only java path..

but in eclipse i added mysql-connector-java-5.1.6.jar as reference..


please help me in this...
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
You can't run applets using the "java" command - applets are not applications.

As to the DB driver, you need to add its jar file in an archive attribute of the applet tag.
srihari miriyala
Greenhorn

Joined: May 16, 2012
Posts: 16
thanks for replay me..

i created SignedAppletOne.jar like



and add this to html page like



while seeing it in a browser i am getting an error this





please help me in this


Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I see - the applet is signed; you didn't mention that before. But the applet tag still doesn't point to the DB driver jar file (which also needs to be signed).

Note that using JDBC in an applet is generally considered a security risk. You should consider using a proxy on the web server instead that the applet would access via HTTP, and which in turn uses JDBC to access the DB. That also obviates the need to open up the firewall on the Mysql port.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Applet - Package