But an exception is thrown: "java.sql.SQLException: Can not issue data manipulation statements with executeQuery()".
public void updateClientsMoney(String name, String password, Long transactValue) throws SQLException {
System.out.println("updateClientsMoney");
String query = "";
if(transactValue < 0) {
query = String.format("UPDATE bank_client SET money %s where name = '%s'", transactValue, name);
} else{
query = String.format("UPDATE bank_client SET money %s where name = '%s'", transactValue, name);
}
try(Statement statement = connection.createStatement()){
statement.executeQuery(query);
}
}