3 Replies Latest reply on May 19, 2008 11:36 AM by peterj

    Database Connection Problem

    badhikary81


      Hi! All
      I have to create a enterprise application .I am using remote server jboss ,J2EE1.4,Mysql and Netbean IDE 6.0.1.1st I have created a Database in remote server using Mysql.When I create a connection using Netbean IDE
      then create the problem , show connection failed error.
      I have used Host name:remote server IP Address , PORT: 3306, DB: mysql database name which is in remote server database name and username and password of remote server Mysql.

      I have also used HOST Name :localhost and rest of all are same.In both case connection failed problem created.

      But I have created a JSP page which contain database connection of remote server.Where i mentioned HOST Name:localhost and PORT:3306 and rest of all are same then connection is established.

      How to solve this problem please tell me. I need some help.
      thanks & regards
      Raj.

        • 1. Re: Database Connection Problem
          peterj

          Please post the following items:

          The *-ds.xml file for you datasource.
          The stack trace for the excpetion you are getting.The code used to access the database.

          • 2. Re: Database Connection Problem
            badhikary81

             

            "PeterJ" wrote:
            Please post the following items:

            The *-ds.xml file for you datasource.
            The stack trace for the excpetion you are getting.The code used to access the database.


            Thanks for reply.
            Here is the main problem that I am not able to connect remote server database which is created by Mysql.that's why I am not able to create CMP Entity Bean for Database.

            When I trying to connect remote server database using Netbean IDE. THEN connection is faild.I am using Host name: IP Address Or 192.168.1.101 and
            Port:3306 ,DB:Remote server Database. UserName and Password of remote server mysql database.

            When I used Host Name:192.168.1.101 then following Stacktrace Exception arise
            java.net.ConnectException: Connection time out:connect
            at java.net.PlainSocketImpl.socketConnect(Native Method )
            at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
            at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
            at java.net.Socket.connect(Socket.java:519)
            at java.net.Socket.connect(Socket.java:469)
            at java.net.Socket.(Socket.java:366)
            at java.net.Socket.(Socket.java:209)
            at com.mysql.jdbc.StandardSocketFactory.Connect(StandardSocketFactory.java:256)
            at com.mysql.jdbc.MysqlIO.(MysqlIO.java:271)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
            at com.mysql.jdbc.Connection.(Connectio.java:1555)
            at com.mysql.jdbc.NonRegisteringDriver.Connect(NonRegisteringDriver.java:285)
            at org.netbeans.modules.db.explorer.DbDriverManager.getConnection(DbDriverManager.java:122)
            org.netbeans.modules.db.explorer..DatabaseConnection s2.run(DatabaseConnection.java:533)
            at org.openide.util.RequestPeocessorS Task.run(RequestProcessor.java:561)


            when I used HostName:IP Address then following exception arise
            Unable to add COnnection:
            jdbc:mysql://IP Address:3306/db:name using mysql.jdbc.Driver(Access denied for us
            er 'cityslikkers'@'122.167.240.76'(using password:YES))


            Please help me how to solve this problem.I need your help sir.
            thanks and regards
            raj

            • 3. Re: Database Connection Problem
              peterj

              Sorry, but I cannot help you with NetBeans (this is the JBossAS forum, after all, not the NetBeans forum). But it does look like the password is incorrect.

              If you need JBossAS help with connection to MySQL, then provide the information I asked for earlier. And the stack trace should come from the JBossAS console log.