Package org.apache.empire.db

Examples of org.apache.empire.db.DBSQLScript.run()


        DBSQLScript script = new DBSQLScript();
        db.getCreateDDLScript(driver, script);
        // Show DLL Statements
        System.out.println(script.toString());
        // Execute Script
        script.run(driver, conn, false);
        db.commit(conn);
        // Open again
        if (!db.isOpen() && !db.open(driver, conn))
        {
            throw new RuntimeException(driver.getErrorMessage());
View Full Code Here


      DBSQLScript script = new DBSQLScript();
    db.getCreateDDLScript(driver, script);
    // Show DDL Statement
    System.out.println(script.toString());
    // Execute Script
    script.run(driver, conn, false);
    // Commit
    db.commit(conn);
  }

  /**
 
View Full Code Here

        DBSQLScript script = new DBSQLScript();
        db.getCreateDDLScript(driver, script);
        // Show DLL Statements
        System.out.println(script.toString());
        // Execute Script
        script.run(driver, conn, false);
        db.commit(conn);
        // Open again
        if (!db.isOpen() && !db.open(driver, conn))
            new RuntimeException(driver.getErrorMessage());
    // Insert Sample Departments
View Full Code Here

        DBSQLScript script = new DBSQLScript();
        db.getCreateDDLScript(driver, script);
        // Show DLL Statements
        System.out.println(script.toString());
        // Execute Script
        script.run(driver, conn, false);
        db.commit(conn);
        // Open again
        if (!db.isOpen() && !db.open(driver, conn))
            new RuntimeException(driver.getErrorMessage());
        // Insert Sample Departments
View Full Code Here

        DBDatabaseDriver driver = new DBDatabaseDriverHSql();
        db = new CompanyDB();
        db.open(driver, conn);
        DBSQLScript script = new DBSQLScript();
        db.getCreateDDLScript(db.getDriver(), script);
        script.run(db.getDriver(), conn, false);
       
       
    }
   
    @AfterClass
View Full Code Here

    public static void shutdown() throws SQLException{
        try{
            DBSQLScript script = new DBSQLScript();
            db.getDriver().getDDLScript(DBCmdType.DROP, db.EMPLOYEE, script);
            db.getDriver().getDDLScript(DBCmdType.DROP, db.DEPARTMENT, script);
            script.run(db.getDriver(), conn, true);
        }finally{
            DBTools.close(conn);
        }
    }
   
View Full Code Here

            if (db.getDriver() instanceof DBDatabaseDriverH2) {
              logger.info("As H2 does not support changing a table with a view defined we remove the view");
              System.out.println("*** drop EMPLOYEE_INFO_VIEW ***");
              DBSQLScript script = new DBSQLScript();
              db.getDriver().getDDLScript(DBCmdType.DROP, db.V_EMPLOYEE_INFO, script);
              script.run(db.getDriver(), conn, false);
            }
            ddlSample(conn, idPers2);
            if (db.getDriver() instanceof DBDatabaseDriverH2) {
              logger.info("And put back the view");
              System.out.println("*** create EMPLOYEE_INFO_VIEW ***");
 
View Full Code Here

            if (db.getDriver() instanceof DBDatabaseDriverH2) {
              logger.info("And put back the view");
              System.out.println("*** create EMPLOYEE_INFO_VIEW ***");
              DBSQLScript script = new DBSQLScript();
              db.getDriver().getDDLScript(DBCmdType.CREATE, db.V_EMPLOYEE_INFO, script);
              script.run(db.getDriver(), conn, false);
            }


            // Done
            System.out.println("DB Sample finished successfully.");
View Full Code Here

        DBSQLScript script = new DBSQLScript();
        db.getCreateDDLScript(driver, script);
        // Show DLL Statement
        System.out.println(script.toString());
        // Execute Script
        script.run(driver, conn, false);
        // Commit
        db.commit(conn);
    }

    /**
 
View Full Code Here

        // Now create the corresponding DDL statement
        System.out.println("Creating new column named FOO as varchar(20) for the EMPLOYEES table:");
        DBSQLScript script = new DBSQLScript();
        db.getDriver().getDDLScript(DBCmdType.CREATE, C_FOO, script);
        script.run(db.getDriver(), conn, false);
       
        // Now load a record from that table and set the value for foo
        System.out.println("Changing the value for the FOO field of a particular employee:");
        DBRecord rec = new DBRecord();
        rec.read(db.T_EMPLOYEES, idTestPerson, conn);
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.