try {
ResultSet values = session.execute(com);
List<Row> list = values.all();
- /*
- if (1 != list.size()) {
- return false;
+ if (0 < list.size()) {
+ String test = list.get(0).getString("Value");
+ id = Long.parseLong(test, 10);
+ } else {
+ // if the MaxUserId parameter does not exist it is inserted with id = 1
+ id = 0;
}
- */
- String test = list.get(0).getString("Value");
- id = Long.parseLong(test, 10);
id++;
com = "INSERT INTO MainParameters (name,value) VALUES ('MaxUserId','" + id + "');";
session.execute(com);
return false;
}
}
-
+
String incom = "INSERT INTO Users (name, id, email, password, organisation, position, signedtolist, registrationdate) VALUES ('"
+ user.getFullName() + "'," + id + ",'" + user.getEmail() + "','" + user.getPassword() + "','"
+ user.getOrganisation() + "','" + user.getPosition() + "'," + user.isUpdateByEmail() + ","