private Boolean checkLogin() throws SQLException {
String query="SELECT COUNT(*) FROM testtable WHERE LOGIN=?";
PreparedStatement preparedStatement = DB.connection.prepareStatement(query);
preparedStatement.setString(1,clientSend.getLogin());
preparedStatement.execute();
}
private Boolean checkLogin() throws SQLException {
String query="SELECT COUNT(*) FROM testtable WHERE LOGIN= :login";
PreparedStatement preparedStatement = DB.connection.prepareStatement(query);
preparedStatement.setString("login", clientSend.getLogin());
ResultSet resultSet = preparedStatement.executeQuery();
if (!resultSet.next()) throw new RuntimeException();
int count = resultSet.getInt(1);
return count == 1;
}