Problem to get count from resultset with select count(1) like query
843859May 5 2006 — edited May 5 2006Hi,
The snippet of code is like this ...!
preparedStatement = connection.prepareStatement("select count(1) as count from acf_users where acf_user_name like ? and acf_user_password like ?");
preparedStatement.setString(1,stringUsername);
preparedStatement.setString(2,stringPassword);
resultSet = preparedStatement.executeQuery() ;
System.out.println("The ResultSet Count checkUser() : "+resultSet.getString("count"));
preparedStatement.close();
But there is a SQLException like :
java.sql.SQLException: ResultSet.next was not called
I want to extract and check the count in the program..
Does anyone has the solution, comments on this.
Thanks in Advance,
-Sachin