I got the PoolingDataSourceExample.java up and running using Vertica driver
easily enough.
I now need to switch to MySQL. I switched out the driver and the uri
particulars. But I am getting the exception below. Interesting enough I
expected issues with Vertica, but not MySQL. You just never know.
Exception in thread "main" java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:459)
at java.util.Properties.setProperty(Properties.java:166)
at
com.mysql.jdbc.NonRegisteringDriver.parseURL(NonRegisteringDriver.java:804)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:316)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at
org.apache.commons.dbcp2.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:79)
at
org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:256)
at
org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:868)
at
org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)
at
org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
at
org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:134)
at com.hp.mo.tas.pool.test.DriverPoolTest.main(DriverPoolTest.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
My setup hasn't really changed much from the working Vertica.
Properties dbProp = new Properties();
dbProp.put("user", aUser);
dbProp.put("password", aPw);
dbProp.put("loginTimeout", "35");
dbProp.put("binaryBatchInsert", "true");
dbProp.put("autocommit", false);
String db = "jdbc:mysql://" + "localhost:3306" + "/" + aDb;
DataSource dataSource = setupDataSource(db, dbProp);
Thanks in advance.
-S
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]