set fetch size; replace quotes only after handling null

This commit is contained in:
Paul Trowbridge 2022-10-25 14:43:30 -04:00
parent 0615163fad
commit 3b4af2bf47

View File

@ -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":