Package java.sql

Examples of java.sql.Statement.closeOnCompletion()


  }

  public static boolean getStandardConformingStrings(Connection con) throws SQLException {

    Statement stmt = con.createStatement();
    stmt.closeOnCompletion();

    ResultSet rs = stmt.executeQuery("SHOW standard_conforming_strings");
    if (rs.next()) {
      return rs.getBoolean(1);
    }
View Full Code Here


     * Test the behavior of closeOnCompletion with a single result set
     */
    public void testSingleResultSet() throws SQLException
    {
        Statement stmt = _conn.createStatement();
        stmt.closeOnCompletion();

        ResultSet rs = stmt.executeQuery(TestUtil.selectSQL("table1", "*"));
        rs.close();
        assertTrue(stmt.isClosed());
    }
View Full Code Here

     * Test the behavior of closeOnCompletion with a multiple result sets
     */
    public void testMultipleResultSet() throws SQLException
    {
        Statement stmt = _conn.createStatement();
        stmt.closeOnCompletion();

        stmt.execute(TestUtil.selectSQL("table1", "*") + ";" +
                     TestUtil.selectSQL("table1", "*") + ";");
        ResultSet rs = stmt.getResultSet();
        rs.close();
View Full Code Here

     * closeOnCompletion has no effect (spec
     */
    public void testNoResultSet() throws SQLException
    {
        Statement stmt = _conn.createStatement();
        stmt.closeOnCompletion();

        stmt.executeUpdate(TestUtil.insertSQL("table1", "1"));
        assertFalse(stmt.isClosed());
    }
}
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.