• 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

Iam not able to connect to database using applets

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I am not able to connect to the database to populate the jTable in JApplets. I had written applet servlet communication program. JApplet is loading in the browser and applet is started. But the data which i want to come from database is not loading. I placed the mysql jar file in tomcat-lib folder. But still iam not able to connect to database. Please help me what i can do.

Thanks,
Nanditha.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does "not able to connect" mean? How are you trying to do that?

You said you have applet/servlet communication in place - so the applet wouldn't connect to the database, it would connect to the servlet, and then the servlet would connect to the database. Which of these parts does or does not work? Are there any error messages in the log files?
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nanditha

Could you post the messages you are getting in the applet console. Somehow I think you are facing the problem of missing connector.
 
Nanditha Parripati
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My applet is getting started. Iam not getting any error message in applet console. But the applet is not connected to database when i am running on tomcat. But when i am running as standalone program it is connected to database and getting the values from database. Standalone program i tried in eclipse ide. When iam running from tomcat, I put the project in webapps folder of my tomcat. then it is not able to load the data from the database. I had the mysql.jar file in tomcat lib folder also. But i am getting why the applet is not connecting to database.

Thanks,
Nanditha.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Iam not getting any error message in applet console.


That's odd; you are talking about the "Java Console", right?

I had the mysql.jar file in tomcat lib folder also.


Any jar file the applet needs must be in a publicly accessible directory (like the directory where the applet's HTML/JSP file is in), and it must be referenced in the applet tag's "archive" attribute. Otherwise the applet can't use it.
 
VineetK Singh
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nanditha

Find out the jre version your browser is using(Internet Options->Advanced->Java(Sun) in the case of I.E). If you are using only a single version of jre, try moving the connector jar in the path C:\Program Files\Java\jre(x)\lib\ext directory. If you are using multiple versions of jre, move this jar to the version, your browser is using to display the aaplets.

You see, as I presume, eclipse is able to locate the connector as it is added into the classpath. But the browser also needs to be able to access this connector to display the applet correctly.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic