I'm trying to do a simple insert into Google BigQuery using the following SQL and receiving the following null pointer exception. What is really strange is that the records actually get inserted and committed to the BigQuery database with the error.
Any ideas how to resolve the error?
The connection information should be good as the same code works with a SQL query.
Simba Driver Version:
- SimbaBigQueryJDBC41-1.0.5.1007
Exception
- Error: ERROR: java.sql.SQLException: [Simba]JDBC Null pointer exception.Prepared Statement Error.
Here's the code:
String CONNECTION_URL=m_Url;
try {
String insertTableSQL = "INSERT INTO `nifty-garden`.babynames.names_2014 (name,gender,count) " +
"VALUES ('Keya','m',1),('keyb','x',1),('keyc','y',2),('keyd','f',5)";
Class.forName("com.simba.googlebigquery.jdbc41.Driver");
con = DriverManager.getConnection(CONNECTION_URL);
PreparedStatement insertPS = con.prepareStatement(insertTableSQL);
insertPS.executeUpdate();
con.commit();
} catch (ClassNotFoundException cnfe) {
logger().error(cnfe, Logger.CHAIN_END, "Class Not Found Exception.");
throw fail();
} catch (SQLException e ) {
logger().error(e, Logger.CHAIN_END, e + "Prepared Statement Error.");
throw fail();
}
I'm suspicious the root cause is due the jackson-core.jar library, but have no evidence to prove my theory.
Thank you so much!