Package java.sql

Examples of java.sql.ResultSet.updateObject()


            rs.updateObject("x", 1, null, 1);
            fail("updateObject should fail when type is null");
        } catch (SQLException se) { assertUnimplemented( se ); }

        try {
            rs.updateObject(1, 1, null, 1);
            fail("updateObject should fail when type is null");
        } catch (SQLException se) { assertUnimplemented( se ); }

        // There should be no more rows.
        JDBC.assertEmpty(rs);
View Full Code Here


  public void testArray() throws SQLException {
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    stmt.executeUpdate("INSERT INTO updateable (id, intarr) VALUES (1, '{1,2,3}'::int4[])");
    ResultSet rs = stmt.executeQuery("SELECT id, intarr FROM updateable");
    assertTrue(rs.next());
    rs.updateObject(2, rs.getArray(2));
    rs.updateRow();

    Array arr = rs.getArray(2);
    assertEquals(Types.INTEGER, arr.getBaseType());
    Integer[] intarr = (Integer[]) arr.getArray();
View Full Code Here

        rs.updateBoolean("C", true);
        rs.insertRow();

        // Test updateObject() with a java.lang.Boolean on various column types
        rs.moveToInsertRow();
        rs.updateObject("B", Boolean.FALSE); // Used to fail with client driver
        rs.updateObject("I", Boolean.FALSE);
        rs.updateObject("C", Boolean.FALSE);
        rs.insertRow();

        rs.close();
View Full Code Here

        rs.insertRow();

        // Test updateObject() with a java.lang.Boolean on various column types
        rs.moveToInsertRow();
        rs.updateObject("B", Boolean.FALSE); // Used to fail with client driver
        rs.updateObject("I", Boolean.FALSE);
        rs.updateObject("C", Boolean.FALSE);
        rs.insertRow();

        rs.close();
View Full Code Here

        // Test updateObject() with a java.lang.Boolean on various column types
        rs.moveToInsertRow();
        rs.updateObject("B", Boolean.FALSE); // Used to fail with client driver
        rs.updateObject("I", Boolean.FALSE);
        rs.updateObject("C", Boolean.FALSE);
        rs.insertRow();

        rs.close();

        JDBC.assertFullResultSet(
View Full Code Here

        // setObject() should also fail when the argument is a byte array
        rs = ps.executeQuery();
        rs.moveToInsertRow();
        try {
            rs.updateObject(1, bytes);
            fail("updateObject should fail");
        } catch (SQLException sqle) {
            assertSQLState(ILLEGAL_UPDATE, sqle);
        }
        rs.close();
View Full Code Here

        rs.next();

        Object value = null;
       
        for (int i = 1; i <= COLUMNS; i++) {
            rs.updateObject(i, value);
            assertNull("Expected rs.getObject(" + i + ") to be null",
                       rs.getObject(i));
            assertTrue("Expected rs.wasNull() to return true",
                       rs.wasNull());
        }
View Full Code Here

        rs.next();

        Object value = null;
       
        for (int i = 1; i <= COLUMNS; i++) {
            rs.updateObject(i, value);
            assertNull("Expected rs.getObject(" + i + ") to be null",
                       rs.getObject(i));
            assertTrue("Expected rs.wasNull() to return true",
                       rs.wasNull());
        }
View Full Code Here

        rs.updateBoolean("C", true);
        rs.insertRow();

        // Test updateObject() with a java.lang.Boolean on various column types
        rs.moveToInsertRow();
        rs.updateObject("B", Boolean.FALSE); // Used to fail with client driver
        rs.updateObject("I", Boolean.FALSE);
        rs.updateObject("C", Boolean.FALSE);
        rs.insertRow();

        rs.close();
View Full Code Here

        rs.insertRow();

        // Test updateObject() with a java.lang.Boolean on various column types
        rs.moveToInsertRow();
        rs.updateObject("B", Boolean.FALSE); // Used to fail with client driver
        rs.updateObject("I", Boolean.FALSE);
        rs.updateObject("C", Boolean.FALSE);
        rs.insertRow();

        rs.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.