Package java.sql

Examples of java.sql.Connection.clearWarnings()


    Connection con = null;
    try {
      con = DriverManager
          .getConnection("jdbc:oce:dcom://192.168.10.142:Konovalov@dlheu0;oce.1c.dbpath=C:\\Developer\\Temp\\Cognos\\Cognos;oce.driver=V81Driver;autoRegistration=true;oce.1c.user=Култашев;oce.1c.password=frkmgxh3");
     
      con.clearWarnings();
      con.commit();
      con.rollback();
     
      con.close();
    } catch (Exception e) {
View Full Code Here


        }

        Connection con = info.getPooledConnection().getConnection();
        try {
            setupDefaults(con, username);
            con.clearWarnings();
            return con;
        } catch (SQLException ex) {
            try {
                con.close();
            } catch (Exception exc) {
View Full Code Here

            try {
                if (statement != null) statement.close();
                if (connection != null) {
                    JDBCExceptionReporter.logWarnings(connection.getWarnings());
                    connection.clearWarnings();
                    connectionProvider.closeConnection(connection);
                    connectionProvider.close();
                }
            } catch (Exception e) {
                log.error("Could not close connection", e);
View Full Code Here

    for ( int i = 0; i <= 3; i++ ) {
      waitFor( sleepTime[i] );
      try {
        Connection con = getConnection();
        try {
          con.clearWarnings();
        } catch ( SQLException ex ) {
          //ignored
        }
        return con;
      } catch ( SQLException ex ) {
View Full Code Here

        Connection target = Mockito.mock(Connection.class);
        ConnectionPoolCallback callback = Mockito.mock(ConnectionPoolCallback.class);
        Connection proxy = jdkConnectionProxyFactory.newInstance(target, callback);
        verify(callback, times(1)).acquireConnection();
        verify(callback, never()).releaseConnection(anyLong());
        proxy.clearWarnings();
        proxy.close();
        verify(target, times(1)).clearWarnings();
        verify(callback, times(1)).releaseConnection(anyLong());
        verifyNoMoreInteractions(callback);
    }
View Full Code Here

         catch (SQLException e) {
            // pass
         }

         try {
            conn.clearWarnings();
            Assert.fail();
         }
         catch (SQLException e) {
            // pass
         }
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

        }
        assertFalse(aes12.didConnectionClosedEventHappen());
        assertTrue(aes12.didConnectionErrorEventHappen());
        aes12.resetState();
        try {
            conn.clearWarnings();
            fail("SQLException of 08003 should be thrown!");
        } catch (SQLException e) {
            assertSQLState("08003", e);
        }
        assertFalse(aes12.didConnectionClosedEventHappen());
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

          // 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

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.