P
parkarumesh
Hi,
I have written a function as follows
public String fetchName(String query) throws Exception
{
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
rs.next();
return (rs.getString(1));
}
If i don't write the statement,
rs.next and directly use rs.getString(1), i get exception
Why is it so, why do we need to move one record next???
Thanks
I have written a function as follows
public String fetchName(String query) throws Exception
{
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
rs.next();
return (rs.getString(1));
}
If i don't write the statement,
rs.next and directly use rs.getString(1), i get exception
Why is it so, why do we need to move one record next???
Thanks