Package java.sql

Examples of java.sql.ResultSet.clearWarnings()


                    updateCountTotal += updateCount;
                }
                if (ret) {
                    resultSet = getStatement().getResultSet();
                    printWarnings(resultSet.getWarnings(), false);
                    resultSet.clearWarnings();
                    if (print) {
                        printResults(resultSet, out);
                    }
                }
                ret = getStatement().getMoreResults();
View Full Code Here


          assertEquals(res.getString(3), res.getString(partitionedColumnName));
        }
        assertFalse("Last result value was not null", res.wasNull());
        assertNull("No warnings should be found on ResultSet", res
            .getWarnings());
        res.clearWarnings(); // verifying that method is supported

        // System.out.println(res.getString(1) + " " + res.getString(2));
        assertEquals(
            "getInt and getString don't align for the same result value",
            String.valueOf(res.getInt(1)), res.getString(1));
View Full Code Here

        assertWarning(warn, CURSOR_OPERATION_CONFLICT);
        assertEquals("Did not expect the resultset to be updated", oldValue, rs.getInt(2));
        assertTrue("Expected rs.rowDeleted() to be false", !rs.rowDeleted());
        assertTrue("Expected rs.rowUpdated() to be false", !rs.rowUpdated());
       
        rs.clearWarnings();
        rs.deleteRow();
        warn = rs.getWarnings();
        assertWarning(warn, CURSOR_OPERATION_CONFLICT);
        rs.relative(0);
        assertTrue("Expected rs.rowUpdated() to be false", !rs.rowUpdated());
View Full Code Here

        // JDBC 4.0 method getHoldabilty to ensure the
        // holdability is reported correctly.
        int orsCount = 0;
        for (Iterator i = openRS.iterator(); i.hasNext();) {
            ResultSet ors = (ResultSet) i.next();
            ors.clearWarnings();
            orsCount++;
        }
        assertEquals("Incorrect number of open result sets", 12, orsCount);

        // Test we cannot switch the connection to holdable
View Full Code Here

        // is closed.
        int crsCount = 0;
        for (Iterator i = openRS.iterator(); i.hasNext();) {
            ResultSet crs = (ResultSet) i.next();
            try {
                crs.clearWarnings();
            } catch (SQLException sqle) {
            }
            crsCount++;
        }
        assertEquals("After global transaction closed ResultSets ", 12,
View Full Code Here

      }
     
      // Send ResultSet warnings if there are any
      SQLWarning sqlw = (rs != null)? rs.getWarnings(): null;
      if (rs != null) {
        rs.clearWarnings();
      }

      // for updatable, insensitive result sets we signal the
      // row updated condition to the client via a warning to be
      // popped by client onto its rowUpdated state, i.e. this
View Full Code Here

        assertTrue(rs.next());
        SQLWarning w = rs.getWarnings();
        assertDataTruncation(w, -1, true, false, 3, 2);
        w = w.getNextWarning();
        assertNull(w);
        rs.clearWarnings(); // workaround for DERBY-5765

        // Second row should have no warnings
        assertTrue(rs.next());
        assertNull(rs.getWarnings());
View Full Code Here

            w = w.getNextWarning();
            assertDataTruncation(w, -1, true, false, 4, 2);
        }
        w = w.getNextWarning();
        assertNull(w);
        rs.clearWarnings(); // workaround for DERBY-5765

        // No more rows
        assertFalse(rs.next());
        rs.close();
View Full Code Here

        ResultSet   rs = getConnection().prepareStatement( "select * from table( warningVTI() ) t" ).executeQuery();

        rs.next();
        assertEquals( "Warning for row 1", rs.getWarnings().getMessage() );
        rs.clearWarnings();
        rs.next();
        assertEquals( "Warning for row 2", rs.getWarnings().getMessage() );

        rs.close();
       
View Full Code Here

        assertWarning(warn, CURSOR_OPERATION_CONFLICT);
        assertEquals("Did not expect the resultset to be updated", oldValue, rs.getInt(2));
        assertTrue("Expected rs.rowDeleted() to be false", !rs.rowDeleted());
        assertTrue("Expected rs.rowUpdated() to be false", !rs.rowUpdated());
       
        rs.clearWarnings();
        rs.deleteRow();
        warn = rs.getWarnings();
        assertWarning(warn, CURSOR_OPERATION_CONFLICT);
        rs.relative(0);
        assertTrue("Expected rs.rowUpdated() to be false", !rs.rowUpdated());
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.