SELECT count(*) <> 0 FROM customers
WHERE name = 'Bob' AND purchase = 'bike'
ResultSet resultSet = statement.executeQuery("SELECT count(*) as cnt FROM customers WHERE name = 'Bob' AND purchase = 'bike'");
resultSet.next(); // not first() with PGSL JDBC it is forward only cursor
final int cnt = resultSet.getInt(1);
System.out.println("cnt: " + cnt);
String query = "SELECT count(*) <> 0 FROM accounts WHERE username = 'bob';";
System.out.println("Executing count query: " + query);
ResultSet resultSet = connection.createStatement().executeQuery(query);
resultSet.next();
final boolean status = resultSet.getBoolean(1);
System.out.println("status: " + status);
exists*
existsCustomerByNameAndPurchase(String name, String purchase);