Hi,
This is the code i am running. The method getJDBCConnection returns a connection object.
Connection con = DataBaseUtil.getJDBCConnection();
String sqlQ = "SELECT item_code FROM item WHERE description = ?";
PreparedStatement pstmt = con.prepareStatement(sqlQ) ;
pstmt.setObject(1," ");
ResultSet rs = pstmt.executeQuery();
int count = 0;
while(rs.next())
{
System.out.println("in while loop "+rs.getString(1));
++count;
}
And there are records which match the criteria if I execute the query as
SELECT item_code FROM item WHERE description = ' '
in TOAD it works and gives me desired result.
But with the prepared statement code it does not work.
Thanks