日期:2014-05-18 浏览次数:20710 次
<% String id=request.getParameter("id"); String sqlstr1,sqlstr2,sqlstr3; String sm="",ms="",sqlselect_str="",ysjkpz="",mb_sqlstr="",mbsjkpz="",gxsz="",n_indexfield="",o_indexfield=""; int dssz,xhcs,dbconfig,indexconfig; //更新的条件获取 sqlstr1="select * from sjjh_config where sjjh_config_id="+id; ds.setCommand(sqlstr1,"oa"); ds.execute(); if(ds.next()){ sm=ds.getString("sm"); ms=ds.getString("ms"); sqlselect_str=ds.getString("sqlselect_str"); ysjkpz=ds.getString("ysjkpz"); mb_sqlstr=ds.getString("mb_sqlstr"); mbsjkpz=ds.getString("mbsjkpz"); gxsz=ds.getString("gxsz"); o_indexfield=ds.getString("o_indexfield"); n_indexfield=ds.getString("n_indexfield"); dssz=ds.getInt("dssz"); xhcs=ds.getInt("xhcs"); dbconfig=ds.getInt("dbconfig"); indexconfig=ds.getInt("indexconfig"); } ds.close(); //获取插入字段名 /**String str = mb_sqlstr; String ss = str.substring(str.indexOf("$") - 1, str.lastIndexOf("$") + 2); String[] arys = ss.split("\\,"); List<String> list = new ArrayList<String>(); for (int i = 0; i < arys.length; i++) { String temp = arys[i]; String date = temp.substring(temp.indexOf("$") + 1, temp.lastIndexOf("$")); list.add(date); } System.out.println(list); **/ //查找目标数据源 ds2.setCommand(sqlselect_str,ysjkpz); ds2.execute(); int sum=0; while(ds2.next()){ //mb_sqlstr = mb_sqlstr.replaceAll("\'\\$", "\'\"\\+"); //mb_sqlstr = mb_sqlstr.replaceAll("\\$\'", "\\+\"\'"); mb_sqlstr= "insert into blob_fjsc(blob_wid,blob_mkmc,blob_data,blob_scsj,blob_fjmc,blob_scr) values("+ds2.getString("blob_wid")+","+ds2.getString("blob_mkmc")+",'',"+ds2.getString("blob_scsj")+","+ds2.getString("blob_fjmc")+","+ds2.getString("blob_scr")+")"; //mb_sqlstr="\""+mb_sqlstr+"\""; //mb_sqlstr="insert into blob_fjsc(blob_wid,blob_mkmc,blob_data,blob_scsj,blob_fjmc,blob_scr) values('"+ds2.getString("blob_wid")+"','"+ds2.getString("blob_mkmc")+"','','"+ds2.getString("blob_scsj")+"','"+ds2.getString("blob_fjmc")+"','"+ds2.getString("blob_scr")+"')"; //ds3.executeUpdate(mb_sqlstr,mbsjkpz); //ds3.executeUpdate("insert into blob_fjsc(blob_wid,blob_mkmc,blob_data,blob_scsj,blob_fjmc,blob_scr) values('"+ds2.getString("blob_wid")+"','"+ds2.getString("blob_mkmc")+"','','"+ds2.getString("blob_scsj")+"','"+ds2.getString("blob_fjmc")+"','"+ds2.getString("blob_scr")+"')",mbsjkpz); mb_sqlstr