如何存储数组表单数据库和另一个数据库

时间:2011-12-19 04:27:51

标签: java jdbc java-me

我尝试读取数据库中的数据并拆分为字符串并存储另一个数据库字段

Statement st2 = connection.createStatement();
Statement st3=connection.createStatement();              
Statement st4 = connection.createStatement();

ResultSet result2 = st2.executeQuery("select msg from INT.rid_RECIVEDETAIL ");

while (result2.next()) {
       String msgincomung = result2.getString("msg");
       System.out.println(msgincomung);

       String[] tem = msgincomung.split("#");

       String phone_no = tem[7];
       String vehical_no = tem[5];
       System.out.println(phone_no);

       st3.executeUpdate("INSERT INTO INT.SMS_RECIVEDEATAI2 (JOB_NO,VEHICAL_NO) VALUES (" + phone_no + ",'" + vehical_no + "')");

     }

0 个答案:

没有答案