Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Daryl Butler   on Oct 20 In Java Category.

  
Question Answered By: Devrim Yilmaz   on Oct 20

I hava some code to access database (DBConector.java)
I use Mysql and the table structure in db_simaba.sql
file. if run that code i have some error like ;

java.sql.SQLException: Unable to connect to any hosts
due to exception:
java.lang.ArrayIndexOutOfBoundsException: 42
at
com.mysql.jdbc.Connection.createNewIO(Connection.java:1797)
at
com.mysql.jdbc.Connection.<init>(Connection.java:562)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:361)
at java.sql.DriverManager.getConnection(Unknown
Source)
at java.sql.DriverManager.getConnection(Unknown
Source)
at
hen.tools.DBConector.getConnection(DBConector.java:34)
at
hen.tools.DBConector.getInstance(DBConector.java:25)
at hen.tools.DBConector.main(DBConector.java:56)

------
But if the data base name is change for example
'db_test', the code run well....

what wrong any body know...?

Share: 

 

This Question has 8 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on JDBC for sql server Or get search suggestion and latest updates.


Tagged: