private PreparedStatement pstmt;
String sql="INSERT INTO TABLE(id,名称,用户id,Stbid,MAC,用户状态,总次数,Ip地址,资料更新时间) " +
"VALUES(?,?,?,?,?,?,?,?,?)";
pstmt=connection.prepareStatement(sql);
pstmt.setString(1,array[0]);
pstmt.setString(2, array[1]);
pstmt.setString(3, array[2]);
pstmt.setString(4, array[3]);
pstmt.setString(5, array[4]);
pstmt.setString(6, array[5]);
pstmt.setString(7, array[6]);
pstmt.setString(8, array[7]);
pstmt.setString(9, array[8]);
pstmt.executeUpdate();
pstmt.close();
connection.commit();
其中TABLE中的各字段的类型均为Char类型。