if(row.columnTypes.get(colList[i]).equals("CHAR") || row.columnTypes.get(colList[i]).equals("DATE") || row.columnTypes.get(colList[i]).equals("TIME") || row.columnTypes.get(colList[i]).equals("TIMESTAMP")){
temp += "'"+value+"'";
} else {
temp += value;
}
}
if(i < colList.length-1){
temp += ", ";
}
}
temp += ")";
row.sql = temp;
} else if(row.sqlOperation.equals("UPDATE")){
temp = "UPDATE ";
Object[] keyList = row.keys.keySet().toArray();
Object[] colList = row.columns.keySet().toArray();
if(row.schemaName != null){
temp += (row.schemaName+".");
}
temp += row.tableName +" SET ";
for(int i = 0; i < colList.length; i++){
temp += colList[i]+"=";
String value = (String)row.columns.get(colList[i]);
if(value == null){
temp += "NULL";
} else {
if(row.columnTypes.get(colList[i]).equals("CHAR") || row.columnTypes.get(colList[i]).equals("DATE") || row.columnTypes.get(colList[i]).equals("TIME") || row.columnTypes.get(colList[i]).equals("TIMESTAMP")){
temp += "'"+value+"'";
} else {
temp += value;
}
}
if(i < colList.length-1){
temp += ", ";
}
}
temp += " WHERE ";
for(int i = 0; i < keyList.length; i++){
temp += keyList[i];
String value = (String)row.keys.get(keyList[i]);
if(value == null){
temp += " IS NULL";
} else {
if(row.keyTypes.get(keyList[i]).equals("CHAR") || row.keyTypes.get(keyList[i]).equals("DATE") || row.keyTypes.get(keyList[i]).equals("TIME") || row.columnTypes.get(keyList[i]).equals("TIMESTAMP")){
temp += "='"+value+"'";
} else {
temp += "="+value;
}
}
if(i < keyList.length-1){
temp += " AND ";
}
}
row.sql = temp;
} else if(row.sqlOperation.equals("DELETE")){
temp="DELETE FROM ";
if(row.schemaName != null){
temp += (row.schemaName+".");
}
temp += row.tableName +" WHERE ";
Object[] keyList = row.keys.keySet().toArray();
for(int i = 0; i < keyList.length; i++){
temp += keyList[i];
String value = (String)row.keys.get(keyList[i]);
if(value == null){
temp += " IS NULL";
} else {
if(row.keyTypes.get(keyList[i]).equals("CHAR") || row.keyTypes.get(keyList[i]).equals("DATE") || row.keyTypes.get(keyList[i]).equals("TIME") || row.columnTypes.get(keyList[i]).equals("TIMESTAMP")){
temp += "='"+value+"'";
} else {
temp += "="+value;
}
}
if(i < keyList.length-1){
temp += " AND ";
}
}
row.sql = temp;
}
}
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.