Package java.sql

Examples of java.sql.ResultSet.moveToInsertRow()


        // Verify that in-place inserts raise an exception if you try to poke a
        // value into a generated column.
        //
        rs = executeQuery( stmt, "select * from t_urs_1 for update" );
        rs.next();
        rs.moveToInsertRow();
        rs.updateInt( 2, 10 );
        expectInsertRowError( rs, CANT_OVERRIDE_GENERATION_CLAUSE );
        rs.close();
        conn.commit();
        assertResults
View Full Code Here


        s.execute("create table derby5042(b boolean, i int, c char(10))");

        ResultSet rs = s.executeQuery("select * from derby5042");

        // Test updateBoolean() on various column types
        rs.moveToInsertRow();
        rs.updateBoolean("B", true); // Used to fail with client driver
        rs.updateBoolean("I", true);
        rs.updateBoolean("C", true);
        rs.insertRow();

View Full Code Here

        rs.updateBoolean("I", true);
        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();
View Full Code Here

        byte[] bytes = "abc".getBytes();

        // Test updateBytes()
        ResultSet rs = ps.executeQuery();
        rs.moveToInsertRow();
        try {
            rs.updateBytes(1, bytes);
            fail("updateBytes should fail");
        } catch (SQLException sqle) {
            assertSQLState(ILLEGAL_UPDATE, sqle);
View Full Code Here

        }
        rs.close();

        // 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);
View Full Code Here

    //DERBY-2966
    //Moving to insert row in a territory based db should not cause exception
    ps = conn.prepareStatement("SELECT * FROM CUSTOMER FOR UPDATE",
        ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
    rs = ps.executeQuery();
    rs.moveToInsertRow();
    rs.close();
    ps.close();
   
    //DERBY-2973
    //alter table modify column should not give an error
View Full Code Here

        s.execute("create table derby5042(b boolean, i int, c char(10))");

        ResultSet rs = s.executeQuery("select * from derby5042");

        // Test updateBoolean() on various column types
        rs.moveToInsertRow();
        rs.updateBoolean("B", true); // Used to fail with client driver
        rs.updateBoolean("I", true);
        rs.updateBoolean("C", true);
        rs.insertRow();

View Full Code Here

        rs.updateBoolean("I", true);
        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();
View Full Code Here

        byte[] bytes = "abc".getBytes();

        // Test updateBytes()
        ResultSet rs = ps.executeQuery();
        rs.moveToInsertRow();
        try {
            rs.updateBytes(1, bytes);
            fail("updateBytes should fail");
        } catch (SQLException sqle) {
            assertSQLState(ILLEGAL_UPDATE, sqle);
View Full Code Here

        }
        rs.close();

        // 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);
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.