--- FM2SQL/Attic/Convert.java 2004/01/16 11:23:49 1.13 +++ FM2SQL/Attic/Convert.java 2004/01/19 08:24:37 1.14 @@ -393,12 +393,13 @@ class Convert int size = bean.getColumnNames().size(); for (int i = 0; i < size - 1; ++i) - command.append(convertText((String)bean.getColumnNames().get(i))+" = ? "); + command.append(convertText((String)bean.getColumnNames().get(i))+" = ? ,"); command.append(convertText((String)bean.getColumnNames().get(size-1))+" = ? "); + command.append("WHERE "+ids.get(tbIndex)+ " = ?"); PreparedStatement pstm = beanDest.getConnection().prepareStatement(command.toString()); - System.out.println(command); - System.exit(0); + System.out.println(command+" "+tbIndex); int rowCount = bean.getRowCount(query); + int idIndex = bean.getColumnNames().indexOf(ids.get(tbIndex) ); while ((row = bean.getNextRow()) != null) { j++; @@ -440,6 +441,9 @@ class Convert else pstm.setNull(k + 1, Types.NULL); } + pstm.setString(row.size()+1,row.get(idIndex).toString()); + System.out.println(pstm.toString()); + // System.exit(0); pstm.execute(); //stm.executeUpdate(command.toString()); if(dialog!=null) @@ -1390,9 +1394,11 @@ public static class DataBase this.creates = creates; this.ids = ids; this.mode = mode; + this.bean.setIDVector(ids); } public void exportToXML(BufferedWriter buffr) throws Exception { + // ids=bean.getIDVector(); buffr.write(" \n"); buffr.write(" "+bean.url+"\n"); buffr.write(" "+bean.user+"\n"); @@ -1417,7 +1423,7 @@ public static class DataBase String create=(String)creates.get(index); String id=(String)ids.get(index); - buffr.write(" \n"); + buffr.write("
\n"); buffr.write(" \n"); if(!create.equals("")) buffr.write(" "+create+" \n");