Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String INSERT_QUERY="INSERT INTO testDb (rid , aid , created_at, expiry_time, strings , strings) VALUES"
- private JsonArray preparedParameters(){
- //JsonArray params = new JsonArray();
- DateTimeFormatter dateTimeFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
- return new JsonArray()
- .add(device.getRecordId().toString())
- .add( device.getAccountId())
- .add(dateTimeFormat.format(device.getCreatedAt()))
- .add(dateTimeFormat.format(device.getExpiresAt()))
- .add( device.getEnrollmentId())
- .add(device.getHashedEnrollmentId());
- }
- try (SQLConnection connection = connectionResult.result()) {
- connection.updateWithParams(INSERT_QUERY,preparedParameters() ,queryRes -> {
- if (queryRes.succeeded()) {
- booleanFuture.complete(true);
- } else {
- booleanFuture.complete(false);
- }
- });
- } catch (Exception e) {
- booleanFuture.complete(false);
- }
- The query contains 0 parameters but you gave it 6 ("sda","sda",2018-01-22 20:23:26,2018-02-21 20:23:26,"sda","sda")
Add Comment
Please, Sign In to add comment