请看下面的代码。
private void printToConsole(List cellDataList) {
for (int i = 1; i < cellDataList.size(); i++) {
List cellTempList = (List) cellDataList.get(i);
System.out.println(cellTempList);
}
}
如何从上面的代码中获取数据以插入数据库。
String sql2 = "INSERT INTO Daily_Report (field1,field2,field3,field4,field5,field6,field7,field8,field9,field10,field11,field12,field13,field14) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
preparedstatement = con3.prepareStatement(sql2);
//Statement stmt = con3.createStatement();
System.out.println("1");
preparedstatement.setString(1, field1);
preparedstatement.setString(2, field2);
preparedstatement.setString(3, field3);
preparedstatement.setString(4, field4);
preparedstatement.setString(5, field5);
preparedstatement.setString(6, field6);
preparedstatement.setString(7, field7);
preparedstatement.setString(8, field8);
preparedstatement.setString(9, field9);
preparedstatement.setString(10, field10);
preparedstatement.setString(11, field11);
preparedstatement.setString(12, field12);
preparedstatement.setString(13, field13);
preparedstatement.setString(14, field14);
preparedstatement.executeUpdate();
您能否提一些建议...