I am trying to implement Hikari Connection Pooling(v 2.3.5). I have everything setup and I am able to retrieve the connection from the pool, and setup a preparedstatement object. Whenever I try to perform any operation on the prepared statement, Hikari throws an internal NPE.
Data Warehouse Task Error
com.hs.task.warehouse.eci.EciConversionException: Failed while converting claims...
at com.hs.task.warehouse.eci.Claims.convertTable(Claims.java:253)
at com.hs.task.warehouse.DataWarehouseTask.execute(DataWarehouseTask.java:76)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.NullPointerException
at com.zaxxer.hikari.proxy.PreparedStatementJavassistProxy.setString(PreparedStatementJavassistProxy.java)
at com.hs.task.warehouse.eci.Claims.convertTable(Claims.java:68)
... 3 more
I am using a very old JDBC driver to a proprietary DB. I have previously used Proxool with this same driver without issue.
Configuration:
HikariConfig hconf = new HikariConfig();
hconf.setDriverClassName("com.dbcswc.fs.jdbc.Driver");
hconf.setJdbcUrl("=jdbc:fs3:MyServer:9584/MyDB;encryption=off;localport=0");
hconf.setUsername("user");
hconf.setPassword("pass");
hconf.setConnectionTestQuery("select 1 as test from pu");
Here is where the error is happening
PreparedStatement psClaims = con.prepareStatement(sql);
psClaims.setString(1, ECI_DT_FMT.format(lastConvertDate));
psClaims is NOT NULL at this point when the setString is called.
ECI_DT_FMT.format(lastConvertDate)
returning null? – brettw