Package play.db

Examples of play.db.DBConfig


            closeConnection(connection);
        }
    }
   
    public static DataSource getDatasource() {
        DBConfig dbConfig = DB.getDBConfig(DBConfig.defaultDbConfigName, true);
        if (dbConfig==null) {
            return null;
        }
        return dbConfig.getDatasource();
    }
View Full Code Here


            dbConfigName = DBConfig.defaultDbConfigName;
        }
       
        try {
            List<String> names = new ArrayList<String>();
            DBConfig dbConfig = DB.getDBConfig(dbConfigName);
            ResultSet rs = dbConfig.getConnection().getMetaData().getTables(null, null, null, new String[]{"TABLE"});
            while (rs.next()) {
                String name = rs.getString("TABLE_NAME");
                names.add(name);
            }
            disableForeignKeyConstraints(dbConfig);
            for (String name : names) {
                if(Arrays.binarySearch(dontDeleteTheseTables, name) < 0) {
                    if (Logger.isTraceEnabled()) {
                        Logger.trace("Dropping content of table %s", name);
                    }
                    dbConfig.execute(getDeleteTableStmt(dbConfig.getUrl(), name) + ";");
                }
            }
            enableForeignKeyConstraints(dbConfig);
            Play.pluginCollection.afterFixtureLoad();
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of play.db.DBConfig

Copyright © 2018 www.massapicom. 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.