| Bug #3022 | Cannot connect to a database with a name longer than 8 Characters | ||
|---|---|---|---|
| Submitted: | 1 Mar 2004 4:23 | Modified: | 1 Mar 2004 8:46 |
| Reporter: | Simon Klaiber | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | Connector / J | Severity: | S3 (Non-critical) |
| Version: | 4.1.1 Server/ 3.0.9 Driver | OS: | |
| Assigned to: | CPU Architecture: | Any | |
[1 Mar 2004 8:46]
Mark Matthews
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at http://www.mysql.com/downloads/

Description: When trying to connect to a databas with a name longer than 8 Chars (9 Chars in my case) I get following Exception when using DriveManager.getConnection(...): java.sql.SQLException: Unable to connect to any hosts due to exception: java.lang.ArrayIndexOutOfBoundsException: 41 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(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at ... my class When transfering the DB in a Database with a shorter Name everything works perfect. How to repeat: use inside a try.. catch block: Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/testtestx", "User", "PWD"):