import java.util.Scanner;
public class Main {
private static Integer invertDigits(Integer number) {
Integer temp = 0;
while (number != 0) {
temp = temp * 10 + number % 10;
number /= 10;
}
return temp;
}
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
Integer number;
System.out.print("Enter number: ");
number = scanner.nextInt();
System.out.println("Reverse digit order: " + invertDigits(number));
}
}
ResultSet result = st.executeQuery("SELECT * FROM users WHERE name = 'name'");
if (!result.isBeforeFirst() ) {
// вернулось 0 строк
}
Returns:
true if the cursor is before the first row; false if the cursor is at any other position or the result set contains no rows