您好,我正在尝试检索两个结果集中的数据。然后,我有店在这两个结果集到字符串数组,这个过程后,我有我的字符串数组存储到另一个表如何使这个请你告诉我..如何使用java在mySql中的表列中存储数组值的值
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = (Connection) DriverManager.
getConnection("jdbc:mysql://localhost:3306/lportal", "root", "ubuntu123");
PreparedStatement stmt = (PreparedStatement) con.
prepareStatement("SELECT * FROM Testi_Testimonial where subject = ?");
stmt.setString(1, search);
stmt.execute();
rs = (ResultSet) stmt.getResultSet();
while (rs.next()) {
anArray[i] = rs.getString("subject");
System.out.println(anArray[i]);
i++;
count++;
}
PreparedStatement stmt1 = (PreparedStatement) con.
prepareStatement("SELECT * FROM Testi_Testimonial where subject != ?");
stmt1.setString(1, search);
stmt1.execute();
rs1 = (ResultSet) stmt1.getResultSet();
while (rs1.next()) {
anArray[i] = rs1.getString("subject");
System.out.println(anArray[i]);
i++;
count++;
}
} catch (Exception e) {
e.printStackTrace();
System.out.println("problem in connection");
}
请告诉我,我应该怎么我的阵列存储Temp
表?我的“温度”表有列subject
我想存储myArray
到subject
列...请告诉我如何做到这一点。
在这个表将存储? – Kapil 2013-04-22 10:44:44
我有我的临时表中的“主题”列..我想存储我的数组到这个列怎么办? – Kapil 2013-04-22 10:46:36
查询中提到的临时表 – 2013-04-22 10:46:37