adejanovski / cassandra-jdbc-wrapper

A JDBC wrapper for the Datastax Java Driver for Cassandra
Apache License 2.0
53 stars 36 forks source link

True on CassandraStatement#execute when inserting #24

Open benyaa opened 5 years ago

benyaa commented 5 years ago

Hey, I was trying to use the jdbc wrapper to batch insert(using batch update of Spring's JdbcTemplate). It is basically an array of sql insert statements(strings).. Now, what happens, is that the check that is done to see if these update statements are valid is if the CassandraStatement#execute function returns true.. Now this happens because the only check that is done this is "this.currentResultSet != null" while it is not null(but the "this.currentResultSet.hasMoreRows()" immediately returns false(so there are no rows returned in this result set.. When it returns true, the JdbcTemplate of Spring throws an exception of it being an invalid batch SQL statement.. The only thing needed is turn this row into "this.currentResultSet != null && this.currentResultSet.hasMoreRows()" or any equivalent .. Thanks :)

EDIT: Also, when opening a connection, it prints "Datacenter: %s; Host: %s; Rack: %s"(forgotten String.fomrat())..