/** * 初始化实际的数据库连接 * * @param dataSource */ protected void initFactualDataSource(BasicDataSource dataSource) { log.info( "Creating data source. Driver: " + type.getDriveClass() + ", url: " + type.getConnUrl() + ", user: "******", password: <not shown>"); dataSource.setDriverClassName(type.getDriveClass()); dataSource.setUsername(type.getUserName()); dataSource.setPassword(type.getUserPass()); dataSource.setUrl(type.getConnUrl()); }
/** * 初始化JDBCProxy回放脚本的Stub数据库连接 * * @param dataSource */ protected void initStubProxyDataSource(BasicDataSource dataSource) { log.info( "Creating data source. Driver: " + type.getDriveClass() + ", url: " + type.getConnUrl() + ", user: "******", password: <not shown>"); dataSource.setDriverClassName("org.jtester.jdbcproxy.driver.FileStubTracerDriver"); dataSource.setUsername(type.getUserName()); dataSource.setPassword(type.getUserPass()); String url = "jdbc:stub:output/mergerfile.xml"; // TODO dataSource.setUrl(url); }
/** * 初始化JDBCProxy的录制脚本的数据库连接 * * @param dataSource */ protected void initRecordProxyDataSource(BasicDataSource dataSource) { log.info( "Creating data source. Driver: " + type.getDriveClass() + ", url: " + type.getConnUrl() + ", user: "******", password: <not shown>"); dataSource.setDriverClassName("nl.griffelservices.proxy.jdbc.oracle.StubTracerDriver"); dataSource.setUsername(type.getUserName()); dataSource.setPassword(type.getUserPass()); String url = String.format( "jdbc:stubtracer:%s:%s:%s", "output", type.getDriveClass(), type.getConnUrl()); dataSource.setUrl(url); }