This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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
Similar Threads
"main" java.sql.SQLException: Access denied for user 'root'@'' (using password: YES)
MYSQL Connection error Plz help
Mysql/JDBC Access Denied Error
mysql query
Connecting with MySql