In the following method:
public boolean isMemberAlive(String userSsn) throws SQLException
{
boolean isMemberAlive = false;
Connection c = null;
Statement s = null;
ResultSet rs = null;
String strSQL = "SELECT Count(*) AS RecordCount " +
"FROM crs.memmst " +
"WHERE memmst_ssn = '" + userSsn + "' AND " +
"(memmst_dt_death IS NULL OR
TRIM(memmst_dt_death) = '')";
try
{
c = CnxOracle.getConnection(schema, schemapwd);
s = c.createStatement();
rs = s.executeQuery(strSQL);
if (rs.next())
{
if (rs.getInt("RecordCount") > 0)
{
isMemberAlive = true;
}
}
}
catch (SQLException exception)
{
recordException(exception);
}
finally
{
rs.close();
s.close();
c.close();
rs = null;
s = null;
c = null;
}
return isMemberAlive;
}
At line #21... if (rs.next()) - the resultset contains a record, rs.next() returns true (I checked using a breakpoint), but the statements in the if block are not executed. The code jumps immediately to the finally block.
This is happening in several (new) methods I've written, but older methods containing similar logic / syntax are working fine.
What is wrong???
Thanks,
Woody