assertNull(rs.getWarnings());
}
public void testGetRowSetWarnings() throws Exception {
noInitialCrset = newNoInitialInstance();
RowSetWarning rsWarning = noInitialCrset.getRowSetWarnings();
assertNotNull(rsWarning);
rs = st.executeQuery("SELECT * FROM USER_INFO");
noInitialCrset.populate(rs);
int index = 0;
while (noInitialCrset.next()) {
index++;
for (int i = 1; i <= DEFAULT_COLUMN_COUNT; i++) {
noInitialCrset.getObject(i);
}
assertEquals(rsWarning, noInitialCrset.getRowSetWarnings());
}
assertTrue(noInitialCrset.absolute(3));
try {
noInitialCrset.getInt(7);
fail("should throw SQLException");
} catch (SQLException e) {
assertEquals(rsWarning, noInitialCrset.getRowSetWarnings());
}
/*
* The ninth column in database is double format, value is 3.99999999.
* It return 4.0F when using getFloat(9).
*/
float doubleValue = noInitialCrset.getFloat(9);
assertEquals(4.0F, doubleValue);
assertEquals(rsWarning, noInitialCrset.getRowSetWarnings());
assertNull(rsWarning.getSQLState());
assertEquals(0, rsWarning.getErrorCode());
noInitialCrset.setMaxFieldSize(3);
noInitialCrset.moveToInsertRow();
noInitialCrset.updateInt(1, 6);
noInitialCrset.updateString(2, "insert");
noInitialCrset.insertRow();
noInitialCrset.moveToCurrentRow();
assertEquals(rsWarning, noInitialCrset.getRowSetWarnings());
assertNull(rsWarning.getSQLState());
assertEquals(0, rsWarning.getErrorCode());
noInitialCrset.acceptChanges(conn);
assertEquals(rsWarning, noInitialCrset.getRowSetWarnings());
assertEquals(0, rsWarning.getErrorCode());
}