hi again,
here's an example of a query and it's java code.
a resultset with no rows (empty) is coming back.
try {
String db2drl = new String("select * from qx05714.person where penr = 1999;");
ResultSet rs = stmt.executeQuery(db2drl);
SQLWarning sqlwarn = stmt.getWarnings();
if ( sqlwarn != null ) {
System.out.println( "SQLWarning: "+sqlwarn.getSQLState() );
} else {
System.out.println("No warnings avail.");
}
} catch (SQLException sqle) {
System.out.println("SQLException-SQLState: "+sqle.getSQLState());
System.out.println("SQLException-Message: "+sqle.getMessage());
} catch (Exception ex) {
System.out.println(ex);
ex.printStackTrace();
}
All what we are getting is No warnings avail.
But i want to see sqlstate 02000.
regards
marc gaines
Quote:
Originally posted by disaster
hi,
thx for reply the post. we are developing our own product to execute sql statement interactiv. the getwarnings() is declared for all interesting objects like the connection, resultset and statement but if we prepare a statement and execute it after that we try to get the sqlwarnings without reposinitioning the cursor for the resultset and getting a null for sqlwarnings all the time. i don't what we else can do !!!
please help us !
marc gaines
|