when i compile this code it gives the following error: abc.java:52: incompatible types found : boolean required: java.sql.ResultSet ResultSet rsB=stB.execute(sqlB); ^ 1 error
STRANGE!!!help me please!!! import java.io.*; import java.net.*; import java.sql.*; class A { public static void main(String str[]) { new B("POST"); } }
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.
kriti sharma
Ranch Hand
Joined: Feb 16, 2001
Posts: 160
posted
0
thank you so much everybody here on the board.i am learning a lot!!!
Java Programmer
Greenhorn
Joined: Apr 20, 2004
Posts: 9
posted
0
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