Compare commits

..

2 Commits

Author SHA1 Message Date
efd922b2e0 v.036 2022-10-25 14:43:53 -04:00
3b4af2bf47 set fetch size; replace quotes only after handling null 2022-10-25 14:43:30 -04:00

View File

@ -35,7 +35,7 @@ public class jrunner {
Integer cols = null;
String[] dtn = null;
msg = "jrunner version 0.35";
msg = "jrunner version 0.36";
msg = msg + nl + "-scu source jdbc url";
msg = msg + nl + "-scn source username";
msg = msg + nl + "-scp source passowrd";
@ -161,6 +161,7 @@ public class jrunner {
//----------------------------------------open resultset------------------------------------------------------------
try {
stmt = scon.createStatement();
stmt.setFetchSize(10000);
rs = stmt.executeQuery(sq);
//while (rs.next()) {
// System.out.println(rs.getString("x"));
@ -201,29 +202,32 @@ public class jrunner {
for (int i = 1; i <= cols; i++){
switch (dtn[i]){
case "VARCHAR":
nc = rs.getString(i).replace("'","''");
nc = rs.getString(i);
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
nc.replace("'","''");
if (trim) { nc = nc.trim();}
nc = "'" + nc + "'";
break;
case "CLOB":
nc = rs.getString(i).replace("'","''");
nc = rs.getString(i);
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
nc.replace("'","''");
if (trim) { nc = nc.trim();}
nc = "'" + nc + "'";
break;
case "CHAR":
nc = rs.getString(i).replace("'","''");
nc = rs.getString(i);
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
nc.replace("'","''");
if (trim) { nc = nc.trim();}
nc = "'" + nc + "'";
break;
@ -239,19 +243,21 @@ public class jrunner {
}
break;
case "TIME":
nc = rs.getString(i).replace("'","''");
nc = rs.getString(i);
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
nc.replace("'","''");
nc = "'" + nc + "'";
break;
case "TIMESTAMP":
nc = rs.getString(i).replace("'","''");
nc = rs.getString(i);
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
nc.replace("'","''");
nc = "'" + nc + "'";
break;
case "BIGINT":