Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24
  1. #21
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Exclamation

    Quote Originally Posted by Tolls View Post
    You're not giving us the full information so we can't really advise you.
    What is the full exception you got?
    Here's the full exception...
    Java Code:
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    
    Last packet sent to the server was 1 ms ago.
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    	at java.lang.reflect.Constructor.newInstance(Unknown Source)
    	at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
    	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103)
    	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
    	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    	at java.lang.reflect.Constructor.newInstance(Unknown Source)
    	at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
    	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
    	at java.sql.DriverManager.getConnection(Unknown Source)
    	at java.sql.DriverManager.getConnection(Unknown Source)
    	at mysqlConnect.Controller.connect(Controller.java:54)
    	at mysqlConnect.Controller.access$200(Controller.java:18)
    	at mysqlConnect.Controller$ButtonHandler.actionPerformed(Controller.java:100)
    	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    	at java.awt.Component.processMouseEvent(Unknown Source)
    	at javax.swing.JComponent.processMouseEvent(Unknown Source)
    	at java.awt.Component.processEvent(Unknown Source)
    	at java.awt.Container.processEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission [0:0:0:0:0:0:0:1]:3306 connect,resolve)
    	at com.mysql.jdbc.StandardSocketFactory.unwrapExceptionToProperClassAndThrowIt(StandardSocketFactory.java:404)
    	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:265)
    	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
    	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2026)
    	... 38 more
    Quote Originally Posted by Tolls View Post
    Is the applet trying to connect to a database on a server other than the one the applet comes from?
    Yes. The link given there a web hosting. I have an account there.
    But I wanted to connect to the database of my account supported by the hosting site.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  2. #22
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,798
    Rep Power
    19

    Default

    "AccessControlException: access denied"

    MySQL needs to be set up to accept connections from outside the server.
    It's possible this hasn't been done with the one on your server.

    I do not know how to do this, before you ask...:)

  3. #23
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Exclamation

    Quote Originally Posted by Tolls View Post
    "AccessControlException: access denied"

    MySQL needs to be set up to accept connections from outside the server.
    It's possible this hasn't been done with the one on your server.

    I do not know how to do this, before you ask...:)
    That's a problem...
    My account doesn't accept external access to the database.
    Should I use a firewall tunneling to bridge the external access issue?
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  4. #24
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    How about this?
    Could I use my .php functions to call a database connection on to my JApplet?
    Or if not, could I use the functions of my .jsp to do the database connection to the JApplet and vise versa?
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. JApplet on MAC
    By ld_pvl in forum Java Applets
    Replies: 0
    Last Post: 08-23-2009, 01:40 PM
  2. JFrame to JApplet or JApplet to JApplet
    By ramesh.8189 in forum AWT / Swing
    Replies: 13
    Last Post: 02-08-2009, 06:14 AM
  3. Replies: 0
    Last Post: 04-01-2008, 10:17 AM
  4. Replies: 0
    Last Post: 09-28-2007, 12:56 PM
  5. JApplet and html
    By paty in forum Java Applets
    Replies: 1
    Last Post: 08-02-2007, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •