version 1.14, 2005/09/06 10:53:16
|
version 1.15, 2005/09/22 12:24:30
|
Line 137 class Convert
|
Line 137 class Convert
|
|
|
static Vector postSQLCommands = new Vector(); |
static Vector postSQLCommands = new Vector(); |
|
|
static final String versionID = new String("FM2SQL Version 0.9.8b\n"); |
static final String versionID = new String("FM2SQL Version 0.9.9b\n"); |
|
|
private static boolean noError = false; |
private static boolean noError = false; |
|
|
Line 539 class Convert
|
Line 539 class Convert
|
destTableName = prop.destTableName; |
destTableName = prop.destTableName; |
if (mode == Convert.DataBase.CONVERT_TEMP_MODE) |
if (mode == Convert.DataBase.CONVERT_TEMP_MODE) |
{ |
{ |
|
String tableNameSave=destTableName; |
destTableName += _TEMP; |
destTableName += _TEMP; |
|
if(creates.get(tbIndex)!="") |
|
{ |
|
System.out.println("Changed tablename of create statement to "+destTableName); |
|
StringBuffer buffer=new StringBuffer(creates.get(tbIndex).toString()); |
|
int startIndex = buffer.indexOf(tableNameSave); |
|
buffer.replace(startIndex,startIndex+tableNameSave.length(),destTableName); |
|
creates.set(tbIndex,buffer.toString()); |
|
} |
} |
} |
|
System.out.println("destTableName is now "+destTableName); |
|
|
fieldNames = prop.fieldNames; |
fieldNames = prop.fieldNames; |
if (mode == Convert.DataBase.CONVERT_MODE || mode == Convert.DataBase.CONVERT_TEMP_MODE) |
if (mode == Convert.DataBase.CONVERT_MODE || mode == Convert.DataBase.CONVERT_TEMP_MODE) |
{ |
{ |
|
|
if (tables.indexOf(destTableName) >= 0) |
if (tables.indexOf(destTableName) >= 0) |
{ |
{ |
stm.executeUpdate("drop table " + beanDest.getQC() + destTableName + beanDest.getQC()); |
stm.executeUpdate("drop table " + beanDest.getQC() + destTableName + beanDest.getQC()); |
Line 588 class Convert
|
Line 598 class Convert
|
command.append(" )"); |
command.append(" )"); |
|
|
} else |
} else |
command = new StringBuffer().append(creates.get(tbIndex).toString().toLowerCase()); |
{ |
|
command = new StringBuffer().append(creates.get(tbIndex).toString()); |
|
} |
stm.executeUpdate(command.toString()); |
stm.executeUpdate(command.toString()); |
|
|
} |
} |
Line 1274 class Convert
|
Line 1286 class Convert
|
else if (modeString.equals("convert_temp")) |
else if (modeString.equals("convert_temp")) |
mode = DataBase.CONVERT_TEMP_MODE; |
mode = DataBase.CONVERT_TEMP_MODE; |
|
|
|
System.out.println("mode ist "+mode); |
// if(node3!=null) |
// if(node3!=null) |
// System.out.println(node3.name); |
// System.out.println(node3.name); |
|
|
Line 2204 class Convert
|
Line 2217 class Convert
|
// CREATE UNIQUE INDEX title_idx ON films (title); |
// CREATE UNIQUE INDEX title_idx ON films (title); |
for (Iterator iter = linesToDelete.iterator(); iter.hasNext();) |
for (Iterator iter = linesToDelete.iterator(); iter.hasNext();) |
{ |
{ |
String id = (String) iter.next(); |
String id = iter.next().toString(); |
delPSt.setString(1, id); |
delPSt.setString(1, id); |
delPSt.execute(); |
delPSt.execute(); |
|
|
Line 2252 class Convert
|
Line 2265 class Convert
|
dialog.title.setText("Retrieving new data"); |
dialog.title.setText("Retrieving new data"); |
} |
} |
|
|
Vector[] vectors = bean.getQueryData(tempQuery, deltaID); |
Vector[] vectors = bean.getQueryData(tempQuery, 0); |
int count = 0, size = vectors[0].size(); |
int count = 0, size = vectors[0].size(); |
int idIndex = vectors[1].indexOf(idField); |
int idIndex = vectors[1].indexOf(idField); |
// System.out.println(idIndex + " " + vectors[1] + " " + idField); |
// System.out.println(idIndex + " " + vectors[1] + " " + idField); |
Line 2295 class Convert
|
Line 2308 class Convert
|
} |
} |
updPst.setString(line.size() + 1, line.get(idIndex).toString()); |
updPst.setString(line.size() + 1, line.get(idIndex).toString()); |
// updPst.addBatch(); |
// updPst.addBatch(); |
// updPst.execute(); |
// System.out.println("updating "+line.get(idIndex).toString()+" "+line); |
|
updPst.execute(); |
} |
} |
if (dialog != null) |
if (dialog != null) |
{ |
{ |