日期:2014-05-18 浏览次数:20808 次
String modSql = "insert into m_modinfo (streamnumber, "
+ "committime, tablename,phoneNumber, sqlset, app) values(?," + "to_date('" + dateString
+ "','yyyy-MM-dd HH24:mi:ss'),?,?,?,?)";
DataSource ds = SessionFactoryUtils.getDataSource(session.getSessionFactory());
Connection conn = ds.getConnection();
ps = conn.prepareStatement(modSql);
for(Iterator<String> it = sqlsetList.iterator(); it.hasNext(); ){
String sqlset = it.next();
ps.setInt(1, streamNumber);
ps.setString(2, "plus_ringboxdepot");
ps.setString(3, provinceId);
ps.setString(4, sqlset);
ps.setString(5, "mng");
ps.addBatch();
}
int[] results = ps.executeBatch();