Examples of Db


Examples of org.apache.torque.adapter.DB

            throws TorqueException
    {
        Query query = new Query();

        final String dbName = crit.getDbName();
        final DB db = Torque.getDB(dbName);
        final DatabaseMap dbMap = Torque.getDatabaseMap(dbName);

        JoinBuilder.processJoins(db, dbMap, crit, query);
        processModifiers(crit, query);
        processSelectColumns(crit, query, dbName);
View Full Code Here

Examples of org.apache.turbine.util.db.adapter.DB

     */
    public static void doDelete(Criteria criteria,
                                DBConnection dbCon)
        throws Exception
    {
        DB db = TurbineDB.getDB( criteria.getDbName() );
        DatabaseMap dbMap = TurbineDB.getDatabaseMap( criteria.getDbName() );
        Connection connection = dbCon.getConnection();

        // Set up a list of required tables and add extra entries to
        // criteria if directed to delete all related records.
View Full Code Here

Examples of org.atomojo.app.db.DB

      testDir = getTestDir(dirName);
     
      dbList = DB.getDatabases(log,testDir);
      if (dbList.isEmpty()) {
         DB db = DB.createDB(log,testDir,"data");
         dbList.put(db.getName(),db);           
         try {
            DB.writeList(testDir,dbList);
         } catch (Exception ex) {
            ex.printStackTrace();
            return;
View Full Code Here

Examples of org.boris.expr.function.excel.DB

import org.boris.expr.function.excel.VDB;

public class ExcelFinancialFunctionsTest extends TH
{
    public void testDB() throws Exception {
        DB d = new DB();
        assertEquals(eval(d, 1000000, 100000, 6, 1, 7), 186083.33333333334);
        assertEquals(eval(d, 1000000, 100000, 6, 2, 7), 259639.41666666667);
        assertEquals(eval(d, 1000000, 100000, 6, 3, 7), 176814.44275000002);
        assertEquals(eval(d, 1000000, 100000, 6, 4, 7), 120410.63551274998);
        assertEquals(eval(d, 1000000, 100000, 6, 5, 7), 81999.64278418274);
View Full Code Here

Examples of org.chaidb.db.Db

        System.setProperty("chaidb.home", dbHome);
        PropertyConfigurator.configure(Database.class.getResource("/org/chaidb/log4j.properties"));
        if (db == null) {
            boolean needRecovery = DBState.getInstance().getNeedRecovery();
            recoverWhenServerStart(needRecovery);
            db = new Db();
        }
        kc = new KernelContext();
        opened = true;
    }
View Full Code Here

Examples of org.h2.jaqu.Db

                throws SQLException {
        Connection conn = null;
        try {
            org.h2.Driver.load();
            conn = DriverManager.getConnection(url, user, password);
            Db db = Db.open(url, user, password.toCharArray());
            DbInspector inspector = new DbInspector(db);
            List<String> models = inspector.generateModel(schema, table,
                    packageName, annotateSchema, trimStrings);
            File parentFile;
            if (StringUtils.isNullOrEmpty(folder)) {
View Full Code Here

Examples of org.h2.jaqu.Db

    public static void main(String... args) throws Exception {
        new AliasMapTest().test();
    }

    public void test() throws Exception {
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.insertAll(Product.getList());

        Product p = new Product();
        List<Product> products = db
            .from(p)
            .where(p.unitsInStock).is(9)
            .orderBy(p.productId).select();

        assertEquals("[]", products.toString());

        db.close();
    }
View Full Code Here

Examples of org.h2.jaqu.Db

        new ClobTest().test();
    }

    public void test() throws Exception {
        String create = "CREATE TABLE CLOB_TEST(ID INT PRIMARY KEY, WORDS {0})";
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.executeUpdate(MessageFormat.format(create, "VARCHAR(255)"));
        db.insertAll(StringRecord.getList());
        testSimpleUpdate(db, "VARCHAR fail");
        db.close();

        db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.executeUpdate(MessageFormat.format(create, "TEXT"));
        db.insertAll(StringRecord.getList());
        testSimpleUpdate(db, "CLOB fail because of single quote artifacts");
        db.close();
    }
View Full Code Here

Examples of org.h2.jaqu.Db

        // a poor test, but a start
        assertEquals(1364, models.get(0).length());
    }

    private void testDatabaseUpgrade() {
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");

        // insert a database version record
        db.insert(new DbVersion(1));

        TestDbUpgrader dbUpgrader = new TestDbUpgrader();
        db.setDbUpgrader(dbUpgrader);

        List<SupportedTypes> original = SupportedTypes.createList();
        db.insertAll(original);

        assertEquals(1, dbUpgrader.oldVersion.get());
        assertEquals(2, dbUpgrader.newVersion.get());
        db.close();
    }
View Full Code Here

Examples of org.h2.jaqu.Db

        assertEquals(2, dbUpgrader.newVersion.get());
        db.close();
    }

    private void testTableUpgrade() {
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");

        // insert first, this will create version record automatically
        List<SupportedTypes> original = SupportedTypes.createList();
        db.insertAll(original);

        // reset the dbUpgrader (clears the update check cache)
        TestDbUpgrader dbUpgrader = new TestDbUpgrader();
        db.setDbUpgrader(dbUpgrader);

        SupportedTypes2 s2 = new SupportedTypes2();

        List<SupportedTypes2> types = db.from(s2).select();
        assertEquals(10, types.size());
        assertEquals(1, dbUpgrader.oldVersion.get());
        assertEquals(2, dbUpgrader.newVersion.get());
        db.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.