Your problem seems to occur at this point:
"SELECT COUNT(NAME) AS N1 FROM USERS"
You can perform your functionality as follow:
Statement st = con.createStatement(); // con is reference of type Connection.
ResultSet rs = st.executeQuery("SELECT COUNT(NAME) AS N1 FROM USERS");
rs.next();
int number = rs.getInt("N1");// the parameter is columnName
//int number = rs.getInt(1);
//the parameter is columnIndex;
System.out.println("Number of
System.out.println("Number of Users : " + number);
rs.close();
con.close();