历史更新记录: 2005-07-16 创建此类型 2008-10-24 增加方法:setTimeout()和getTimeout()方法,设置在执行SQL时的超时时间 2008-10-27 对于更新操作的返回结果,以前是返回null,现在调整为返回Integer类型的更新计数 2008-10-27 增加批量执行SQL方法executeBatch()
34353637383940
private final Log logger = LogFactory.getLog(this.getClass()); private SqlRunner sqlRunner; public SpringSqlUnitTestExecutionListener() { this.sqlRunner = SqlRunner.of(new SqlExecutor()); }
101102103104105106107108109
parameterMaps = new HashMap(); requestPool = new ThrottledPool(RequestScope.class, DEFAULT_MAX_REQUESTS); sessionPool = new ThrottledPool(SessionScope.class, DEFAULT_MAX_SESSIONS); sqlExecutor = new SqlExecutor(); typeHandlerFactory = new TypeHandlerFactory(); dataExchangeFactory = new DataExchangeFactory(typeHandlerFactory); }
105106107108109110111112113
848586878889909192
mappedStatements = new HashMap(); cacheModels = new HashMap(); resultMaps = new HashMap(); parameterMaps = new HashMap(); sqlExecutor = new SqlExecutor(); typeHandlerFactory = new TypeHandlerFactory(); dataExchangeFactory = new DataExchangeFactory(typeHandlerFactory); }
106107108109110111112113114
9899100101102103104105106107108
mappedStatements = new HashMap(); cacheModels = new HashMap(); resultMaps = new HashMap(); parameterMaps = new HashMap(); sqlExecutor = new SqlExecutor(); typeHandlerFactory = new TypeHandlerFactory(); dataExchangeFactory = new DataExchangeFactory(typeHandlerFactory); DEBUG.P(0, this, "SqlMapExecutorDelegate()"); }
2223242526272829303132
throws DaoGenerateException { DataAccessExecutor executor = EXECUTOR_CACHE.get(method); if (executor == null) { CacheExecutor cacheExecutor = createCacheExecutor(cacheManager, method); SqlExecutor sqlExecutor = createSqlExecutor(dataAccessor, method); cacheExecutor.setDataAccessExecutor(sqlExecutor); executor = cacheExecutor; EXECUTOR_CACHE.put(method, executor);
434445464748495051
return executor; } private static SqlExecutor createSqlExecutor(JdbcDataAccessor dataAccessor, Method method) throws DaoGenerateException { SqlExecutor executor = new SqlExecutor(dataAccessor, method); return executor; }
132133134135136137138139140141142143
Connection con = null; log.info("Start migration of database."); try { InputStreamReader inreader = new InputStreamReader(in); con = JDBCUtil.getDBConnection(); SqlExecutor sqlex = new SqlExecutor(con, false); sqlex.runCommands(inreader); } catch (SQLException e) { log.error("SQL error during database migration: ", e); return false; } catch (IOException e) { log.error("IO error during database migration: ", e);
6364656667686970717273
/** * 创建MssqlSQLExecutor的实例,以SQLExecutor类型返回 */ public SQLExecutor create() { SQLExecutor executor = new MssqlSQLExecutor(transaction, connId); // if(mker!=null){ // executor.setResultMaker(mker); // } return executor; }