Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Applet - Package

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Saloon Keeper
Posts: 6448
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 6448
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Arthur, where are your pants? Check under this tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic