-
-
Save emmanuelbernard/13d22d15dc983a83a7e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HEre is the output | |
*** For statementINSERT INTO "Bookmark"("id","isPrivate","isShared","stockCount","isRead") VALUES (?,?,?,?,?); | |
index: 0 data type: varchar columnValue: 2cb2b441-46a5-47af-aabe-e30a5b102ea6 | |
*** For statementINSERT INTO "Bookmark"("id","isPrivate","isShared","stockCount","isRead") VALUES (?,?,?,?,?); | |
index: 1 data type: varchar columnValue: F | |
From the following code change | |
private ResultSet bindAndExecute(Object[] columnValues, RegularStatement statement) { | |
try { | |
PreparedStatement preparedStatement = session.prepare( statement ); | |
BoundStatement boundStatement = new BoundStatement( preparedStatement ); | |
for ( int i = 0; i < columnValues.length; i++ ) { | |
DataType dataType = preparedStatement.getVariables().getType( i ); | |
// FIXME Code change here | |
System.out.println( | |
"*** For statement" + statement + " \n\tindex: " + i + " data type: " + preparedStatement.getVariables() | |
.getType( i ) + " columnValue: " + columnValues[i] ); | |
boundStatement.setBytesUnsafe( i, dataType.serialize( columnValues[i], protocolVersion ) ); | |
} | |
return session.execute( boundStatement ); | |
} | |
catch (DriverException e) { | |
log.failToExecuteCQL( statement.getQueryString(), e ); | |
throw e; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment