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 Connecting with MySql 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 "Connecting with MySql" Watch "Connecting with MySql" New topic

Connecting with MySql

abhijeet srivastava

Joined: Aug 22, 2006
Posts: 26
I try to connect mysql using mysql connector 3.0.17 through jdbc by following code :
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root12");

when i run this program i got the following error:
java.sql.SQLException:error during query Unexpected Exception:java.lang. ArrayindexOutofBoundException message given :35

while my driver is loaded but problem occur in getConnection method.
same code is running on windows system but not in the linux plateform.
still i dont know how to solve this problem

Please help me.
biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
i think you may be using the driver for windows not for linux

Biny Balan
abhijeet srivastava

Joined: Aug 22, 2006
Posts: 26
I am using mysql connector/j mysql-connector-java-3.0.17-ga-bin.jar
Is it only for windows?
I agree. Here's the link:
subject: Connecting with MySql
Similar Threads
JBoss CMP: "auto-increment" not recognised
What is the Java URL to connect to mysql server in Ubuntu when installed using apt?
Mysql and JDBC problem
Problem in Java Connection with MySQL in Linux Mandriva.
Download file from Mysql database