try { switch (database) { case DbHelper.DB_POSTGRES: Class.forName("org.postgresql.Driver"); break; case DbHelper.DB_ORACLE: Class.forName("oracle.jdbc.driver.OracleDriver"); break; default: throw new IllegalArgumentException("unsupported database"); }  Connection conn = DriverManager.getConnection(jdbc, user, password); conn.setAutoCommit(false); ConnectionSource source = new DedicatedConnectionSource(conn); MetadataRoot root = PDL.loadDirectory(new File(pdl)); SessionManager.open("default", root, source, database); } catch (ClassNotFoundException e) { throw new UncheckedWrapperException(e); } catch (SQLException e) { throw new UncheckedWrapperException(e); }
Connection conn = getConnection(); ConnectionSource source = new DedicatedConnectionSource(conn); MetadataRoot root = PDL.loadDirectory(new File(pdl)); SessionManager.open("default", root, source, database);
    private void openSession() {        TestConfig conf = new TestConfig();        String pdl = conf.getPDL();        String jdbc = conf.getURL();        String user = conf.getUser();        String password = conf.getPassword();        int database = conf.getDatabase();        DbHelper.setDatabase(database);        try {            switch (database) {            case DbHelper.DB_POSTGRES:                Class.forName("org.postgresql.Driver");                break;            case DbHelper.DB_ORACLE:                Class.forName("oracle.jdbc.driver.OracleDriver");                break;            default:                throw new IllegalArgumentException("unsupported database");            }            Connection conn =                DriverManager.getConnection(jdbc, user, password);            conn.setAutoCommit(false);            ConnectionSource source = new DedicatedConnectionSource(conn);            MetadataRoot root = PDL.loadDirectory(new File(pdl));            SessionManager.open("default", root, source, database);        } catch (ClassNotFoundException e) {            throw new UncheckedWrapperException(e);        } catch (SQLException e) {            throw new UncheckedWrapperException(e);        }    }