Package com.ibatis.common.jdbc

Examples of com.ibatis.common.jdbc.ScriptRunner.runScript()


    ScriptRunner runner = new ScriptRunner(conn, false, false);
    runner.setLogWriter(null);
    runner.setErrorLogWriter(null);

    runner.runScript(reader);
    conn.commit();
    conn.close();
    reader.close();
  }
View Full Code Here


        }
        if (createTables) {
            ScriptRunner sr = new ScriptRunner(dataSource.getConnection(), false, false);
            sr.setLogWriter(null);
            sr.setErrorLogWriter(null);
            sr.runScript(new InputStreamReader(this.getClass().getResourceAsStream("/" + createSql)));
            if (createSqlInd != null && !createSqlInd.equals("")) {
                sr.runScript(new InputStreamReader(this.getClass().getResourceAsStream("/" + createSqlInd)));
            } else {
                LOG.warning("The script to create indexes has not been set. Indexes will not be created.");
            }
View Full Code Here

            ScriptRunner sr = new ScriptRunner(dataSource.getConnection(), false, false);
            sr.setLogWriter(null);
            sr.setErrorLogWriter(null);
            sr.runScript(new InputStreamReader(this.getClass().getResourceAsStream("/" + createSql)));
            if (createSqlInd != null && !createSqlInd.equals("")) {
                sr.runScript(new InputStreamReader(this.getClass().getResourceAsStream("/" + createSqlInd)));
            } else {
                LOG.warning("The script to create indexes has not been set. Indexes will not be created.");
            }
        }
    }
View Full Code Here

    Integer count = getJdbcTemplate().queryForObject( SELECT, Integer.class );
    if ( count == null || count == 1 ) {
      Connection con = this.getDataSource().getConnection();
      ScriptRunner runner = new ScriptRunner( con, true, true );
      runner.runScript( Resources.getResourceAsReader( "sql/createdb_h2.sql" ) );
    }
  }
}
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.