Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat Applet MySQL

Status
Not open for further replies.

ilevine

Technical User
Nov 3, 2003
4
US
I have an applet that goes through another Java class to communicate with a database. Everything works perfectly when it runs from the local file system (c:\applet.html). But when I run it in Tomcat ( it opens the applet, but no data is fetched from the database. It seems like a Tomcat problem to me. Any suggestions are appreciated.
 
No error messages. In appletviewer or in IE everything works fine. Under Tomcat it says applet started, but does not work. I check the log files and there are no errors there. I think it might be a connection problem or a security thing.
 
Correction, I found this error when further debugging.

java.sql.SQLException: Cannot connect to MySQL server on 24.46.143.152:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.security.AccessControlException)

at com.mysql.jdbc.Connection.connectionInit(Unknown Source)

at com.mysql.jdbc.jdbc2.Connection.connectionInit(Unknown Source)

at com.mysql.jdbc.Driver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)
 
Got it. Used 127.0.0.1 in the connect class and Tomcat was okay with it. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top