日期:2014-05-20 浏览次数:20827 次
try { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); Date fileDate = sdf.parse("20080528"); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); }
public int[] executeMUpDateBatch(String sKind){ int[] result = null; String TableName = getConfig(sKind); if(upDates==null) return result; try { Connection conn = DATABASE.connPool.getConnection(); PreparedStatement ps = conn.prepareStatement(upMSql); for(int i=0;i<upDates.size();i++){ ps.setString(1, upDates.get(i).get(0)); ps.setString(2, upDates.get(i).get(1)); ps.setString(3, upDates.get(i).get(2)); ps.setString(4, upDates.get(i).get(3)); ps.setString(5, upDates.get(i).get(4)); ps.setString(6, upDates.get(i).get(5)); ps.setString(7, upDates.get(i).get(6)); ps.setString(8, upDates.get(i).get(7)); ps.setString(9, upDates.get(i).get(8)); ps.setString(10, upDates.get(i).get(9)); ps.addBatch(); // for(int j=1;j<upDates.get(i).size();j++){ // ps.setString(j, upDates.get(i).get(j-1)); // } } result = ps.executeBatch(); DATABASE.connPool.returnConnection(conn); return result; } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } }