Examples of DBDatabaseDriver


Examples of org.apache.empire.db.DBDatabaseDriver

                }
                // maxItems
                maxItems = lti.getPageSize();
                skipRows = position;
                // constraint
                DBDatabaseDriver driver = queryCmd.getDatabase().getDriver();
                if (driver.isSupported(DBDriverFeature.QUERY_LIMIT_ROWS))
                {   // let the database limit the rows
                    if (skipRows>0 && driver.isSupported(DBDriverFeature.QUERY_SKIP_ROWS))
                    {   // let the database skip the rows
                        queryCmd.skipRows(skipRows);
                        skipRows = 0;
                    }
                    queryCmd.limitRows(skipRows+maxItems);
View Full Code Here

Examples of org.apache.empire.db.DBDatabaseDriver

  public void useGeneratedCode() throws Exception {

    MyDB db = MyDB.get();
    Employees EMP = db.EMPLOYEES;

    DBDatabaseDriver driver = new DBDatabaseDriverHSql();
    db.open(driver, conn);
    DBCommand cmd = db.createCommand();
    cmd.select(EMP.EMPLOYEE_ID, EMP.FIRSTNAME);

    int rowCount = 0;
View Full Code Here

Examples of org.apache.empire.db.DBDatabaseDriver

    sampleDB = new SampleDB();

    // Open Database (and create if not existing)
    log.info("*** open database ***");
    String driverProvider = config.getDatabaseProvider();
    DBDatabaseDriver driver = getDatabaseDriver(driverProvider);
    Connection conn = null;
    try {
      conn = getConnection(sampleDB);
      sampleDB.open(driver, conn);
      if (!databaseExists(conn)) {
View Full Code Here

Examples of org.apache.empire.db.DBDatabaseDriver

      log.info("*** getJDBCConnection() ***");
      conn = getJDBCConnection(servletContext);

      // Choose a driver
      log.info("*** create DBDatabaseDriverOracle() ***");
      DBDatabaseDriver driver = getDatabaseDriver(config.getDatabaseProvider());

            // Open Database (and create if not existing)
            log.info("*** open database ***");
            try {
                // Open the database
View Full Code Here

Examples of org.apache.empire.db.DBDatabaseDriver

            System.out.println("*** Step 1: getJDBCConnection() ***");
            Connection conn = getJDBCConnection();

            // STEP 2: Choose a driver
            System.out.println("*** Step 2: getDatabaseProvider() ***");
            DBDatabaseDriver driver = getDatabaseDriver(config.getDatabaseProvider());

            // STEP 3: Open Database (and create if not existing)
            System.out.println("*** Step 3: openDatabase() ***");
            try {
                // Enable the use of prepared statements for update and insert commands as well as for read operations on a DBRecord.
View Full Code Here

Examples of org.apache.empire.db.DBDatabaseDriver

            String driverClassName = config.getEmpireDBDriverClass();
            if (StringUtils.isEmpty(driverClassName))
                throw new RuntimeException("Configuration error: Element 'empireDBDriverClass' not found in node 'properties-"+provider+"'");

            // Create driver
            DBDatabaseDriver driver = (DBDatabaseDriver) Class.forName(driverClassName).newInstance();

            // Configure driver
            config.readProperties(driver, "properties-"+provider, "empireDBDriverProperites");

            // done
View Full Code Here

Examples of org.apache.empire.db.DBDatabaseDriver

                // maxItems
                maxItems = lti.getPageSize();
                skipRows = position;
                // constraint
                queryCmd.clearLimit();
                DBDatabaseDriver driver = queryCmd.getDatabase().getDriver();
                if (driver.isSupported(DBDriverFeature.QUERY_LIMIT_ROWS))
                {   // let the database limit the rows
                    if (driver.isSupported(DBDriverFeature.QUERY_SKIP_ROWS))
                    {   // let the database skip the rows
                        queryCmd.skipRows(skipRows);
                        skipRows = 0;
                    }
                    queryCmd.limitRows(skipRows+maxItems);
View Full Code Here

Examples of org.apache.empire.db.DBDatabaseDriver

    {
        ErrorObject.setExceptionsEnabled(true);
       
        Connection conn = dbResource.getConnection();
    
        DBDatabaseDriver driver = dbResource.newDriver();
        CompanyDB db = new CompanyDB();
        db.open(driver, dbResource.getConnection());
        DBSQLScript script = new DBSQLScript();
        db.getCreateDDLScript(db.getDriver(), script);
        script.run(db.getDriver(), dbResource.getConnection(), false);
View Full Code Here

Examples of org.apache.empire.db.DBDatabaseDriver

  @Test
  public void testChineseCharacters()
  {
    Connection conn = dbResource.getConnection();

    DBDatabaseDriver driver = dbResource.newDriver();
    CompanyDB db = new CompanyDB();

    // Encoding issue occur when prepared statement is disabled
    //db.setPreparedStatementsEnabled(true);
View Full Code Here

Examples of org.apache.empire.db.DBDatabaseDriver

            System.out.println("*** Step 1: getJDBCConnection() ***");
            Connection conn = getJDBCConnection();

            // STEP 2: Choose a driver
            System.out.println("*** Step 2: getDatabaseProvider() ***");
            DBDatabaseDriver driver = getDatabaseDriver(config.getDatabaseProvider());

            // STEP 3: Open Database (and create if not existing)
            System.out.println("*** Step 3: openDatabase() ***");
            try {
                // Enable the use of prepared statements for update and insert commands as well as for read operations on a DBRecord.
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.