version 1.42, 2004/03/02 12:04:27
|
version 1.43, 2004/03/03 12:10:33
|
Line 667 class Convert
|
Line 667 class Convert
|
if(dialog!=null) |
if(dialog!=null) |
dialog.title.setText("Writing table data ..."); |
dialog.title.setText("Writing table data ..."); |
|
|
command = writeDatainDestTable(dialog, command, k, pstm, rowCount); |
command = writeDatainDestTable(dialog, command, k, pstm, rowCount,delimiter); |
endIndex = k + deltaID; |
endIndex = k + deltaID; |
} |
} |
System.out.println(endIndex); |
System.out.println(endIndex); |
Line 688 class Convert
|
Line 688 class Convert
|
bean.makeQuery(tempQuery, 0); |
bean.makeQuery(tempQuery, 0); |
if(dialog!=null) |
if(dialog!=null) |
dialog.title.setText("Writing table data ..."); |
dialog.title.setText("Writing table data ..."); |
command = writeDatainDestTable(dialog, command, endIndex, pstm, rowCount); |
command = writeDatainDestTable(dialog, command, endIndex, pstm, rowCount,delimiter); |
} |
} |
// prepare new query for next chunk |
// prepare new query for next chunk |
if (query.indexOf("where") > 0) |
if (query.indexOf("where") > 0) |
Line 705 class Convert
|
Line 705 class Convert
|
long startTime = System.currentTimeMillis(); |
long startTime = System.currentTimeMillis(); |
|
|
bean.makeQuery(query, 0); |
bean.makeQuery(query, 0); |
command = writeDatainDestTable(dialog, command, j, pstm, rowCount); |
command = writeDatainDestTable(dialog, command, j, pstm, rowCount,delimiter); |
long endTime = System.currentTimeMillis(); |
long endTime = System.currentTimeMillis(); |
System.out.println("Time for old convert elapsed " + (endTime - startTime)); |
System.out.println("Time for old convert elapsed " + (endTime - startTime)); |
|
|
Line 748 class Convert
|
Line 748 class Convert
|
* @throws Exception |
* @throws Exception |
* @throws SQLException |
* @throws SQLException |
*/ |
*/ |
private static StringBuffer writeDatainDestTable(FM2SQL.ProgressDialog dialog, StringBuffer command, int j, PreparedStatement pstm, int rowCount) throws Exception, SQLException |
private static StringBuffer writeDatainDestTable(FM2SQL.ProgressDialog dialog, StringBuffer command, int j, PreparedStatement pstm, int rowCount,String delimiter) throws Exception, SQLException |
{ |
{ |
Vector row; |
Vector row; |
while ((row = bean.getNextRow()) != null) |
while ((row = bean.getNextRow()) != null) |
Line 795 class Convert
|
Line 795 class Convert
|
obj = row.get(k); |
obj = row.get(k); |
if (obj instanceof ArrayList) |
if (obj instanceof ArrayList) |
if (obj instanceof ArrayList) |
if (obj instanceof ArrayList) |
obj = formatFileMakerArray((List) obj," | "); |
obj = formatFileMakerArray((List) obj,delimiter); |
|
|
String str = (obj == null) ? "NULL" : obj.toString(); |
String str = (obj == null) ? "NULL" : obj.toString(); |
if (!str.equals("NULL")) |
if (!str.equals("NULL")) |
Line 1276 class Convert
|
Line 1276 class Convert
|
Node delimiterNode =root.find("convert/source/database/delimiter", new int[] { 1, 1, i, 1, 1 }); |
Node delimiterNode =root.find("convert/source/database/delimiter", new int[] { 1, 1, i, 1, 1 }); |
|
|
if(delimiterNode!=null) delimiter = delimiterNode.getCharacters(); |
if(delimiterNode!=null) delimiter = delimiterNode.getCharacters(); |
|
System.out.println("delimiter "+delimiterNode.getCharacters()); |
if (node3 == null) |
if (node3 == null) |
throw new Error("parse error database tag missing"); |
throw new Error("parse error database tag missing"); |
if (node == null) |
if (node == null) |
Line 1304 class Convert
|
Line 1304 class Convert
|
mode = DataBase.APPEND_MODE; |
mode = DataBase.APPEND_MODE; |
else if (modeString.equals("update")) |
else if (modeString.equals("update")) |
mode = DataBase.UPDATE_MODE; |
mode = DataBase.UPDATE_MODE; |
|
|
// if(node3!=null) |
// if(node3!=null) |
// System.out.println(node3.name); |
// System.out.println(node3.name); |
|
|
Line 1354 class Convert
|
Line 1353 class Convert
|
creates.add(""); |
creates.add(""); |
|
|
} |
} |
databases.add(new DataBase(database, tables, layouts, selects, creates, ids, mode)); |
DataBase dataBase=new DataBase(database, tables, layouts, selects, creates, ids, mode); |
|
dataBase.delimiter=delimiter; |
|
databases.add(dataBase); |
} |
} |
DBBean database = new DBBean(); |
DBBean database = new DBBean(); |
// parse dataBase |
// parse dataBase |
Line 1461 class Convert
|
Line 1462 class Convert
|
Vector layouts; |
Vector layouts; |
Vector tables; |
Vector tables; |
Vector ids; |
Vector ids; |
String delimiter = "|"; |
String delimiter = "//"; |
final static int CONVERT_MODE = 1; |
final static int CONVERT_MODE = 1; |
final static int APPEND_MODE = 2; |
final static int APPEND_MODE = 2; |
final static int UPDATE_MODE = 3; |
final static int UPDATE_MODE = 3; |