Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot connect to mysql server from applet

 
Yahya Elyasse
Ranch Hand
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I wrote an applet that connect to a mysql db server. I'm using Eclipse IDE. when i run Applet from Eclipse it runs fine and do the job.
when i used an html file to start the applet then all the troubles began

I signed the applet with a personnel certificate..imported it to IE browser and started the applet from IE...i was prompted if i trust applet and i choosed yes. But again i had the following exception :

Java Plug-in 1.5.0_05


----------------------------------------------------

Exception: java.sql.SQLException: Cannot connect to MySQL server on db70c.pair.com:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.security.AccessControlException)
java.sql.SQLException: Cannot connect to MySQL server on db70c.pair.com: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 DatabaseData.connect(DatabaseData.java:358)
at StockGraph.initComponents(StockGraph.java:228)
at StockGraph.init(StockGraph.java:54)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at DatabaseData.getStockCode(DatabaseData.java:19)
at StockGraph.queryDatabase(StockGraph.java:62)
at StockGraph.initComponents(StockGraph.java:230)
at StockGraph.init(StockGraph.java:54)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at StockGraph.queryDatabase(StockGraph.java:66)
at StockGraph.initComponents(StockGraph.java:230)
at StockGraph.init(StockGraph.java:54)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
--------------------------------------------------------
what can i do to solve this problem ?

please help this is driving me crazy !

thanks.
 
Joe Ess
Bartender
Posts: 9337
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We here at the JavaRanch ask that everyone use your real name. As our Naming Policy states, accounts with obviously fictitious names will be closed.
You can change your displayed name here.
Thanks

Originally posted by E.othman:
Hi guys,
when i run Applet from Eclipse it runs fine and do the job.
when i used an html file to start the applet then all the troubles began

When you run an applet through Eclipse, it runs as an application through the Java Appletviewer and is not subject to applet security constraints.


I signed the applet with a personnel certificate..imported it to IE browser and started the applet from IE...i was prompted if i trust applet and i choosed yes. But again i had the following exception :


What do you mean you "imported" the applet to IE? Are you downloading the applet through a web server?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic