[jboss-dev-forums] [JBoss Web Development] - DB connection problem on JBoss/Linux

sbutt do-not-reply at jboss.com
Mon Sep 28 06:57:57 EDT 2009


Hi Folks,
            I'm having problems in connecting to a mySql DB through JDBC on JBoss.

I'm using the following code.

 try
  |       {
  |           String userName = "admin";
  |           String password = "m9ad3e";
  |           String url = "jdbc:mysql://hh-linux1/IntegraDB";
  |           Class.forName ("com.mysql.jdbc.Driver").newInstance ();
  |           conn = DriverManager.getConnection (url, userName, password);
  |           System.out.println ("Database connection established");
  |                  
  |           
  |       }
  |       catch (Exception e)
  |       {
  |         e.printStackTrace();
  |           System.err.println ("Cannot connect to database server");
  |       }

It works fine on Windows/Tomcat.

But when i deploy the .war file on JBoss server running on linux it gives exception.

java.sql.SQLException: Access denied for user 'admin'@'HH-Linux1.usbeck.de' (using password: YES)
  | 2009-09-28 12:56:09,844 ERROR [STDERR]  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
  | 2009-09-28 12:56:09,844 ERROR [STDERR]  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:798)
  | 2009-09-28 12:56:09,844 ERROR [STDERR]  at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3700)
  | 2009-09-28 12:56:09,844 ERROR [STDERR]  at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1203)
  | 

it is even trying to connect to some other server somehow admin'@'HH-Linux1.usbeck.de'?

Can someone pls help.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257321#4257321

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257321



More information about the jboss-dev-forums mailing list