用SESSION执行
1.获取事务的session
2.用session执行
用插件实现
public class JdbcUtil {
static ComboPooledDataSource dataSource_ora;
static ComboPooledDataSource dataSource_gp;
static ComboPooledDataSource dataSource_gp_test;
static {
try {
//设置连接池大小
dataSource_ora = new ComboPooledDataSource();
dataSource_ora.setInitialPoolSize(20);
dataSource_ora.setMinPoolSize(10);
dataSource_ora.setMaxPoolSize(50);
dataSource_ora.setUser("username");
dataSource_ora.setPassword("password");
dataSource_ora.setDriverClass("oracle.jdbc.driver.OracleDriver");
dataSource_ora.setJdbcUrl("jdbc:oracle:thin:@//10.10.10.10:1521/dbname");
} catch (PropertyVetoException e) {
e.printStackTrace();
}
}
ProductHis是自定义的实体类