Pierre Goupil
2011-12-21 14:24:02 UTC
Good afternoon,
I'm currently trying and configure MySQL in order to have an in-memory
database in my unit tests. My environment is: Linux 3.0.0, Java 6 openJDK,
MySQL connector 5.0.7 and MXJ 5.0.12.
Here's my code:
------------------
String driver = System.getProperty("SQL_DRIVER", "com.mysql.jdbc.Driver");
String defaultUrl =
"jdbc:mysql:///test?propertiesTransform=com.mysql.management.jmx.ConnectorMXJPropertiesTransform";
String url = System.getProperty("SQL_URL", defaultUrl);
String user = System.getProperty("SQL_USER", "root");
String password = System.getProperty("SQL_PW", "");
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, user, password);
------------------
I get an exception at the last line:
------------------
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0,
Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:571)
at java.util.ArrayList.get(ArrayList.java:349)
at
com.mysql.management.jmx.ConnectorMXJPropertiesTransform.<init>(ConnectorMXJPropertiesTransform.java:63)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at
com.mysql.jdbc.NonRegisteringDriver.parseURL(NonRegisteringDriver.java:639)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:280)
at java.sql.DriverManager.getConnection(DriverManager.java:620)
at java.sql.DriverManager.getConnection(DriverManager.java:200)
at mxj.Start.main(Start.java:25)
------------------
A clue, anyone? Any help will be much appreciated.
Regards,
Pierre Goupil
I'm currently trying and configure MySQL in order to have an in-memory
database in my unit tests. My environment is: Linux 3.0.0, Java 6 openJDK,
MySQL connector 5.0.7 and MXJ 5.0.12.
Here's my code:
------------------
String driver = System.getProperty("SQL_DRIVER", "com.mysql.jdbc.Driver");
String defaultUrl =
"jdbc:mysql:///test?propertiesTransform=com.mysql.management.jmx.ConnectorMXJPropertiesTransform";
String url = System.getProperty("SQL_URL", defaultUrl);
String user = System.getProperty("SQL_USER", "root");
String password = System.getProperty("SQL_PW", "");
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, user, password);
------------------
I get an exception at the last line:
------------------
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0,
Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:571)
at java.util.ArrayList.get(ArrayList.java:349)
at
com.mysql.management.jmx.ConnectorMXJPropertiesTransform.<init>(ConnectorMXJPropertiesTransform.java:63)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at
com.mysql.jdbc.NonRegisteringDriver.parseURL(NonRegisteringDriver.java:639)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:280)
at java.sql.DriverManager.getConnection(DriverManager.java:620)
at java.sql.DriverManager.getConnection(DriverManager.java:200)
at mxj.Start.main(Start.java:25)
------------------
A clue, anyone? Any help will be much appreciated.
Regards,
Pierre Goupil
--
Si tu penses que la violence ne résout rien, c'est que tu n'as pas tapé
assez fort.
Si tu penses que la violence ne résout rien, c'est que tu n'as pas tapé
assez fort.