Package java.sql

Examples of java.sql.Connection.clearWarnings()


        // We should not have gotten any warnings
        // and should have gotten a scroll insensitive cursor
        warning = conn.getWarnings();
        assertNull(warning);
        conn.clearWarnings();

        // Verify that setMaxRows(-1) fails
        try {
            s_i_r.setMaxRows(-1);
            // Should never get here
View Full Code Here


        else
            assertEquals("01J10", warning.getSQLState());

        assertNull(warning.getNextWarning());

        conn.clearWarnings();
        cs_s_r.close();

        cs_s_u = conn.prepareCall("values cast (? as Integer)",
                ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
View Full Code Here

            assertEquals("01J02", warning.getSQLState());
        else
            assertEquals("01J10", warning.getSQLState());

        assertNull(warning.getNextWarning());
        conn.clearWarnings();
        cs_s_u.close();

        cs_i_r = conn.prepareCall("values cast (? as Integer)",
                ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
View Full Code Here

        // We should have gotten 0 warnings
        warning = conn.getWarnings();
        assertNull(warning);

        conn.clearWarnings();
        cs_i_r.close();

        cs_f_r = conn.prepareCall("values cast (? as Integer)",
                ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
View Full Code Here

        // We should have gotten 0 warnings
        warning = conn.getWarnings();
        assertNull(warning);

        conn.clearWarnings();
        cs_f_r.close();

    }

    /**
 
View Full Code Here

        }
        assertFalse(aes12.didConnectionClosedEventHappen());
        assertTrue(aes12.didConnectionErrorEventHappen());
        aes12.resetState();
        try {
            conn.clearWarnings();
        } catch (SQLException e) {
                assertSQLState("08003", e);
        }
        assertFalse(aes12.didConnectionClosedEventHappen());
        assertTrue(aes12.didConnectionErrorEventHappen());
View Full Code Here

          // This connection isn't usable.
          return null;
        }

        cached.rollback(); // Reset any transaction state.
        cached.clearWarnings();

        LOG.debug("Got cached connection for " + key);
      }

      return cached;
View Full Code Here

        }
        assertFalse(aes12.didConnectionClosedEventHappen());
        assertTrue(aes12.didConnectionErrorEventHappen());
        aes12.resetState();
        try {
            conn.clearWarnings();
        } catch (SQLException e) {
                assertSQLState("08003", e);
        }
        assertFalse(aes12.didConnectionClosedEventHappen());
        assertTrue(aes12.didConnectionErrorEventHappen());
View Full Code Here

        if(obj instanceof Connection) {
            Connection conn = (Connection)obj;
            if(!conn.getAutoCommit()) {
                conn.rollback();
            }
            conn.clearWarnings();
            conn.setAutoCommit(true);
        }
        if(obj instanceof DelegatingConnection) {
            ((DelegatingConnection)obj).passivate();
        }
View Full Code Here

                                   + " to create the PooledConnection.");
        }

        Connection con = info.getPooledConnection().getConnection();       
        setupDefaults(con, username);
        con.clearWarnings();
        return con;
    }

    protected abstract PooledConnectionAndInfo
        getPooledConnectionAndInfo(String username, String password)
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.