Examples of DbDataStore


Examples of org.apache.jackrabbit.core.data.db.DbDataStore

    public void test() throws Exception {
        try {

            if (TEST_DATABASE) {
                DbDataStore dds = new DbDataStore();
                String dbPath = (testDir + "/db").replace('\\', '/');

                // 3 sec
                String url = "jdbc:h2:mem:" + dbPath + "/db";

                // 4 sec
                // String url = "jdbc:h2:" + dbPath + "/db";

                // 26 sec
                // String url = "jdbc:derby:" + dbPath + "/db";

                new File(dbPath).mkdirs();
                dds.setUrl(url + ";create=true");
                dds.setUser("sa");
                dds.setPassword("sa");
                dds.setCopyWhenReading(false);
                dds.init(dbPath);
                // doTest(dds, 0);
                doTestMultiThreaded(dds, 4);
                dds.close();
                shutdownDatabase(url);

                FileUtils.deleteDirectory(testDir);
                new File(dbPath).mkdirs();
                dds = new DbDataStore();
                dds.setUrl(url + ";create=true");
                dds.setUser("sa");
                dds.setPassword("sa");
                dds.setCopyWhenReading(true);
                dds.init(dbPath);
                // doTest(dds, 0);
                doTestMultiThreaded(dds, 4);
                dds.close();
                shutdownDatabase(url);
            }

            FileDataStore fds = new FileDataStore();
            fds.init(testDir + "/file");
View Full Code Here

Examples of org.apache.jackrabbit.core.data.db.DbDataStore

    }

    private void doTestDatabase(String driver, String url, String user, String password) throws Exception {
        ConnectionFactory pool = new ConnectionFactory();
        try {
            DbDataStore store = new DbDataStore();
            store.setConnectionFactory(pool);

            ids.clear();

            store.setDriver(driver);
            store.setUrl(url);
            store.setUser(user);
            store.setPassword(password);

            store.init("target/test-db-datastore");
            store.setMinRecordLength(0);
            doTest(store);
        } finally {
            pool.close();
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.data.db.DbDataStore

    public void test() throws Exception {
        try {

            if (TEST_DATABASE) {
                DbDataStore dds = new DbDataStore();
                String dbPath = (testDir + "/db").replace('\\', '/');

                // 3 sec
                String url = "jdbc:h2:mem:" + dbPath + "/db";

                // 4 sec
                // String url = "jdbc:h2:" + dbPath + "/db";

                // 26 sec
                // String url = "jdbc:derby:" + dbPath + "/db";

                new File(dbPath).mkdirs();
                dds.setUrl(url + ";create=true");
                dds.setUser("sa");
                dds.setPassword("sa");
                dds.setCopyWhenReading(false);
                dds.init(dbPath);
                // doTest(dds, 0);
                doTestMultiThreaded(dds, 4);
                dds.close();
                shutdownDatabase(url);

                FileUtils.deleteDirectory(testDir);
                new File(dbPath).mkdirs();
                dds = new DbDataStore();
                dds.setUrl(url + ";create=true");
                dds.setUser("sa");
                dds.setPassword("sa");
                dds.setCopyWhenReading(true);
                dds.init(dbPath);
                // doTest(dds, 0);
                doTestMultiThreaded(dds, 4);
                dds.close();
                shutdownDatabase(url);
            }

            FileDataStore fds = new FileDataStore();
            fds.init(testDir + "/file");
View Full Code Here

Examples of org.apache.jackrabbit.core.data.db.DbDataStore

   
    public void test() throws Exception {
        try {
           
            if (TEST_DATABASE) {
                DbDataStore dds = new DbDataStore();
                String dbPath = (testDir + "/db").replace('\\', '/');
               
                // 3 sec
                String url = "jdbc:h2:mem:" + dbPath + "/db";
               
                // 4 sec
                // String url = "jdbc:h2:" + dbPath + "/db";
               
                // 26 sec
                // String url = "jdbc:derby:" + dbPath + "/db";
               
                new File(dbPath).mkdirs();
                dds.setUrl(url + ";create=true");
                dds.setUser("sa");
                dds.setPassword("sa");
                dds.setCopyWhenReading(false);
                dds.init(dbPath);
                // doTest(dds, 0);
                doTestMultiThreaded(dds, 4);
                dds.close();
                shutdownDatabase(url);
               
                FileUtils.deleteDirectory(testDir);
                new File(dbPath).mkdirs();
                dds = new DbDataStore();
                dds.setUrl(url + ";create=true");
                dds.setUser("sa");
                dds.setPassword("sa");
                dds.setCopyWhenReading(true);
                dds.init(dbPath);
                // doTest(dds, 0);
                doTestMultiThreaded(dds, 4);
                dds.close();
                shutdownDatabase(url);
            }

            FileDataStore fds = new FileDataStore();
            fds.init(testDir + "/file");
View Full Code Here

Examples of org.apache.jackrabbit.core.data.db.DbDataStore

   
    public void test() throws Exception {
        try {
           
            if (TEST_DATABASE) {
                DbDataStore dds = new DbDataStore();
                String dbPath = (testDir + "/db").replace('\\', '/');
               
                // 3 sec
                String url = "jdbc:h2:mem:" + dbPath + "/db";
               
                // 4 sec
                // String url = "jdbc:h2:" + dbPath + "/db";
               
                // 26 sec
                // String url = "jdbc:derby:" + dbPath + "/db";
               
                new File(dbPath).mkdirs();
                dds.setUrl(url + ";create=true");
                dds.setUser("sa");
                dds.setPassword("sa");
                dds.setCopyWhenReading(false);
                dds.init(dbPath);
                // doTest(dds, 0);
                doTestMultiThreaded(dds, 4);
                dds.close();
                shutdownDatabase(url);
               
                FileUtils.deleteDirectory(testDir);
                new File(dbPath).mkdirs();
                dds = new DbDataStore();
                dds.setUrl(url + ";create=true");
                dds.setUser("sa");
                dds.setPassword("sa");
                dds.setCopyWhenReading(true);
                dds.init(dbPath);
                // doTest(dds, 0);
                doTestMultiThreaded(dds, 4);
                dds.close();
                shutdownDatabase(url);
            }

            FileDataStore fds = new FileDataStore();
            fds.init(testDir + "/file");
View Full Code Here

Examples of org.apache.jackrabbit.core.data.db.DbDataStore

    @Reference
    private ConnectionFactory connectionFactory;

    @Override
    protected DataStore createDataStore(ComponentContext context, Map<String, Object> config) {
        DbDataStore dataStore = new DbDataStore();
        dataStore.setConnectionFactory(connectionFactory);
        return dataStore;
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.data.db.DbDataStore

    }

    private void doTestDatabase(String driver, String url, String user, String password) throws Exception {
        ConnectionFactory pool = new ConnectionFactory();
        try {
            DbDataStore store = new DbDataStore();
            store.setConnectionFactory(pool);

            ids.clear();

            store.setDriver(driver);
            store.setUrl(url);
            store.setUser(user);
            store.setPassword(password);

            store.init("target/test-db-datastore");
            store.setMinRecordLength(0);
            doTest(store);
        } finally {
            pool.close();
        }
    }
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.