Hi Kriti, It certainly pays to go through the Javadoc, the execute method returns a boolean and the executeQuery() returns a ResultSet. execute should be followed by getResultSet() to get the ResultSet.
Joined: Feb 16, 2001
thank you so much everybody here on the board.i am learning a lot!!!
Joined: Apr 20, 2004
see execute(sql) returns boolean type and u r catching it in ResultSet object. To get ResultSet object use either executeQuery(sql) or getResultSet(sql) on Statement object.
"Java Programmer", We're pleased to have you here with us in the JDBC forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it. In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Thanks! bear Forum Bartender