Reputation: 5141
I've been assigned to develop a small Java application to process some data from a DB2 database(used for logging business transactions), and I know a little about the internal settings of the datbase. Currently, I am struggling to find out why a query executed on my application(through JDBC) gives a different result set from a direct query executed on my Quest Central for DB2 client.
String query = "SELECT DISTINCT SYSTEM_NME FROM MISUSER.USAGE_LOGGER";
try {
Connection conn = DB2Connect.getDB2Connection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
while(rs.next()){
retval.add(rs.getString(this.code.column_name));
}
} catch (SQLException e) {...
The above code returns a ResultSet object with 7 rows, while the same query executed on my db2 client returns more than 30 rows. As mentioned earlier, I have minimal experience working with database, and I need some sort of idea how the same query can generate two different results.
Upvotes: 3
Views: 3022
Reputation: 1109422
Several causes.
Upvotes: 4