I am not able to connect to the database to populate the jTable in JApplets. I had written appletservlet 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.
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?
Could you post the messages you are getting in the applet console. Somehow I think you are facing the problem of missing connector.
Copy Paste is a design error!!
Joined: Jul 20, 2009
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.
Joined: Mar 22, 2005
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.
Joined: Jun 02, 2009
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.
subject: Iam not able to connect to database using applets