Package javax.sql.rowset

Examples of javax.sql.rowset.JdbcRowSet.execute()


    public void testExecute_DeleteCmd() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setCommand("DELETE FROM USER_INFO");
        jrs.setUrl(DERBY_URL);
        try {
            jrs.execute();
            fail("should throw SQLException");
        } catch (SQLException e) {
            // expected
        }
        jrs.close();
View Full Code Here


    public void testExecute_InsertCmd() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setCommand("insert into USER_INFO(ID,NAME) values (6,'insert6')");
        jrs.setUrl(DERBY_URL);
        try {
            jrs.execute();
            fail("should throw SQLException");
        } catch (SQLException e) {
            // expected
        }
        jrs.close();
View Full Code Here

    public void testUpdateRow_Normal() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.setUrl(DERBY_URL);
        jrs.execute();

        assertTrue(jrs.absolute(3));
        assertEquals(3, jrs.getInt(1));
        assertEquals("test3", jrs.getString(2));
        jrs.updateString(2, "update3");
View Full Code Here

    public void testUpdateRow_Exception() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.setUrl(DERBY_URL);
        jrs.execute();

        assertTrue(jrs.absolute(-2));
        assertEquals("test3", jrs.getString(2));
        jrs.updateRow();
        assertFalse(jrs.rowUpdated());
View Full Code Here

    public void testDeleteRow() throws Exception {
        insertMoreData(6);
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.setUrl(DERBY_URL);
        jrs.execute();

        assertTrue(jrs.first());
        jrs.deleteRow();

        try {
View Full Code Here

         * same as ResultSet.
         */
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.setUrl(DERBY_URL);
        jrs.execute();

        jrs.moveToInsertRow();
        jrs.updateInt(1, 5);
        jrs.updateString(2, "insert5");
        jrs.insertRow();
View Full Code Here

        // Creates jdbc rowset.
        JdbcRowSet jdbcRs;
        jdbcRs = newJdbcRowSet();
        jdbcRs.setCommand("SELECT * FROM USER_INFO");
        jdbcRs.setUrl(DERBY_URL);
        jdbcRs.execute();

        jdbcRs.setMatchColumn(1);
        jrs.addRowSet(jdbcRs);

        CachedRowSet returnRowset = (CachedRowSet) jrs.getRowSets().iterator()
View Full Code Here

        // Creates jdbc rowset.
        JdbcRowSet jdbcRs;
        jdbcRs = newJdbcRowSet();
        jdbcRs.setCommand("SELECT * FROM USER_INFO");
        jdbcRs.setUrl(DERBY_URL);
        jdbcRs.execute();

        jdbcRs.setMatchColumn("ID");
        jrs.addRowSet(jdbcRs);

        if (System.getProperty("Testing Harmony") == "true") {
View Full Code Here

    protected JdbcRowSet newJdbcRowSet() throws Exception {
        JdbcRowSet noInitalJrs = noInitalJdbcRowSet();
        noInitalJrs.setUrl(DERBY_URL);
        noInitalJrs.setCommand("SELECT * FROM USER_INFO");
        noInitalJrs.execute();
        return noInitalJrs;
    }

}
View Full Code Here

        // Creates jdbc rowset.
        JdbcRowSet jdbcRs;
        jdbcRs = newJdbcRowSet();
        jdbcRs.setCommand("SELECT * FROM USER_INFO");
        jdbcRs.setUrl(DERBY_URL);
        jdbcRs.execute();

        jdbcRs.setMatchColumn(1);
        jrs.addRowSet(jdbcRs);

        CachedRowSet returnRowset = (CachedRowSet) jrs.getRowSets().iterator()
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.