Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JDBC and Relational Databases and the fly likes Exception while connecting to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Exception while connecting to database" Watch "Exception while connecting to database" New topic

Exception while connecting to database

Karan Raj

Joined: Jan 27, 2004
Posts: 16
i am getting the following exception when i try to connect to mysql from my program.
i am trying to connect with the following program statement
The user samurai already exists in the database;
java.sql.SQLException: General error, message from server: "Access denied for user: 'samurai@bithorax' to database 'mysql'"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.doHandshake(
at com.mysql.jdbc.Connection.createNewIO(
at com.mysql.jdbc.Connection.<init>(
at com.mysql.jdbc.NonRegisteringDriver.connect(
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
i am unable to traceout the problem please help in this.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Have you seen this thread?
I agree. Here's the link:
subject: Exception while connecting to database
jQuery in Action, 3rd edition