Code example for Connection

Methods: createStatementsetTransactionIsolation

0
     */ 
    @Override 
    protected void setUp() throws java.lang.Exception { 
        Class.forName(getDriverClassName()).newInstance();
        firstConnection = DriverManager.getConnection(getConnectionURL());
        firstConnection.setTransactionIsolation(getTransactionIsolation());
        secondConnection = DriverManager.getConnection(getConnectionURL());
        secondConnection.setTransactionIsolation(getTransactionIsolation());
        firstStmt = firstConnection.createStatement();
        firstStmt.execute("create table tbl1(one varchar(10), two smallint)");
        secondStmt = secondConnection.createStatement();
    } 
 
    /** 
     * Tears down a unit test, by setting the auto commit property of the first 
     * connection back to true, dropping the test table and closing the two 
     * connections. 
     */ 
    @Override 
    protected void tearDown() throws SQLException { 
        firstStmt.close();