print headers for each section; evaluate null as a potential string object status
This commit is contained in:
parent
ccb1ca589a
commit
54ab5645b1
@ -118,11 +118,14 @@ public class jrunner {
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(scu);
|
||||
System.out.println(scn);
|
||||
System.out.println(dcu);
|
||||
System.out.println(dcn);
|
||||
System.out.println("------------db info---------------------------------------");
|
||||
System.out.println("source db uri: " + scu);
|
||||
System.out.println("source db username: " + scn);
|
||||
System.out.println("destination db uri: " + dcu);
|
||||
System.out.println("destination username: " + dcn);
|
||||
System.out.println("------------source sql------------------------------------");
|
||||
System.out.println(sq);
|
||||
System.out.println("------------destination table-----------------------------");
|
||||
System.out.println(dt);
|
||||
|
||||
//return;
|
||||
@ -152,8 +155,8 @@ public class jrunner {
|
||||
e.printStackTrace();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
//----------------------------------------open resultset------------------------------------------------------------
|
||||
System.out.println("issue connecting to desctination:");
|
||||
try {
|
||||
stmt = scon.createStatement();
|
||||
rs = stmt.executeQuery(sq);
|
||||
@ -169,6 +172,7 @@ public class jrunner {
|
||||
//---------------------------------------build meta---------------------------------------------------------------
|
||||
try {
|
||||
cols = rs.getMetaData().getColumnCount();
|
||||
System.out.println("------------source metadata-------------------------------");
|
||||
System.out.println("number of cols: " + cols);
|
||||
getv = new String[cols + 1];
|
||||
dtn = new String[cols + 1];
|
||||
@ -185,6 +189,7 @@ public class jrunner {
|
||||
e.printStackTrace();
|
||||
System.exit(0);
|
||||
}
|
||||
System.out.println("------------row count-------------------------------------");
|
||||
//-------------------------------build & execute sql-------------------------------------------------------------
|
||||
try {
|
||||
while (rs.next()) {
|
||||
@ -193,7 +198,7 @@ public class jrunner {
|
||||
nr = "";
|
||||
for (int i = 1; i <= cols; i++){
|
||||
nc = rs.getString(i);
|
||||
if (dtn[i] == "DATE" && nc == "null") {
|
||||
if (nc == null) {
|
||||
nc = "NULL";
|
||||
}
|
||||
else {
|
||||
@ -292,5 +297,6 @@ public class jrunner {
|
||||
System.out.println("issue closing connections");
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user