I'm attempting to access some data that I get from a Java ResultSet
object.
Context ctx = new InitialContext();
DataSource datasource = ctx.lookup("database")
PreparedStatement query = datasource.getConnection().prepareStatement( "select * \n" +
"from appDb.market a \n" +
"where not exists \n" +
"(select * from mainDb.market b where a.id = b.id);");
ResultSet rs = query.executeQuery();
if (rs.next()){
//The code will not reach this condition
System.out.println("Data found!");
}
However, for some reason, rs.next() is not evaluating to true, even though currently, the ResultSet's rowData does have rows..
I can access the result set's rowData object in the debugging tools, and can see that the size of rows is 1, however, I cannot access said row. I think I must be doing something silly, but am not so sure.