I am using the following code in selenium, but I am not able to retrieve data from database. I am getting the errors "The result set has no current row"
My code is
public class Auto {
public static void main(String[] args) throws InterruptedException, SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
System.out.println("Driver loaded");
Connection con=DriverManager.getConnection("jdbc:sqlserver://192.168.*****\\SQLEXPRESS/*****_DW/EPS:****;user=******;password=******; ");
System.out.println("Driver loadedd");
java.sql.Statement stmt= con.createStatement();
ResultSet rs=stmt.executeQuery("select * from [*****_DW].[dbo].dim_grantee ");
System.out.println("Query executed");
while (rs.next());
{
String Name=rs.getString("NAME");
System.out.println("Name is");
}
}