stat.execute("INSERT INTO TEST VALUES(7, -99999999.99, -99999999.99)");
stat.execute("INSERT INTO TEST VALUES(8, NULL, NULL)");
rs = stat.executeQuery("SELECT * FROM TEST ORDER BY ID");
assertResultSetMeta(rs, 3, new String[] { "ID", "D", "R" },
new int[] { Types.INTEGER, Types.DOUBLE, Types.REAL }, new int[] { 10, 17, 7 }, new int[] { 0, 0, 0 });
BigDecimal bd;
rs.next();
assertTrue(rs.getInt(1) == 1);
assertTrue(!rs.wasNull());
assertTrue(rs.getInt(2) == -1);
assertTrue(rs.getInt(3) == -1);
assertTrue(!rs.wasNull());
bd = rs.getBigDecimal(2);
assertTrue(bd.compareTo(new BigDecimal("-1.00")) == 0);
assertTrue(!rs.wasNull());
o = rs.getObject(2);
trace(o.getClass().getName());
assertTrue(o instanceof Double);
assertTrue(((Double) o).compareTo(new Double("-1.00")) == 0);
o = rs.getObject(3);
trace(o.getClass().getName());
assertTrue(o instanceof Float);
assertTrue(((Float) o).compareTo(new Float("-1.00")) == 0);
rs.next();
assertTrue(rs.getInt(1) == 2);
assertTrue(!rs.wasNull());
assertTrue(rs.getInt(2) == 0);
assertTrue(!rs.wasNull());
assertTrue(rs.getInt(3) == 0);
assertTrue(!rs.wasNull());
bd = rs.getBigDecimal(2);
assertTrue(bd.compareTo(new BigDecimal("0.00")) == 0);
assertTrue(!rs.wasNull());
bd = rs.getBigDecimal(3);
assertTrue(bd.compareTo(new BigDecimal("0.00")) == 0);
assertTrue(!rs.wasNull());
rs.next();
assertEquals(1.0, rs.getDouble(2));
assertEquals(1.0f, rs.getFloat(3));
rs.next();