diff --git a/app/src/main/java/jrunner/jrunner.java b/app/src/main/java/jrunner/jrunner.java index 0036ddc..6ed05f1 100644 --- a/app/src/main/java/jrunner/jrunner.java +++ b/app/src/main/java/jrunner/jrunner.java @@ -193,44 +193,49 @@ public class jrunner { nr = ""; for (int i = 1; i <= cols; i++){ nc = rs.getString(i); - if (rs.wasNull()) { + if (dtn[i] == "DATE" && nc == "null") { nc = "NULL"; - } else { - switch (dtn[i]){ - case "VARCHAR": - nc = rs.getString(i).replace("'","''"); - if (trim) { nc = nc.trim();} - nc = "'" + nc + "'"; - break; - case "CLOB": - nc = rs.getString(i).replace("'","''"); - if (trim) { nc = nc.trim();} - nc = "'" + nc + "'"; - break; - case "CHAR": - nc = rs.getString(i).replace("'","''"); - if (trim) { nc = nc.trim();} - nc = "'" + nc + "'"; - break; - case "DATE": - nc = "'" + rs.getString(i) + "'"; - if (nc == "'1/1/0001 12:00:00 AM'") { - nc = "NULL"; - } - break; - case "TIME": - nc = "'" + rs.getString(i).replace("'","''") + "'"; - break; - case "BIGINT": - nc = rs.getString(i); - default: - if (rs.getString(i) != "") { + } + else { + if (rs.wasNull()) { + nc = "NULL"; + } else { + switch (dtn[i]){ + case "VARCHAR": + nc = rs.getString(i).replace("'","''"); + if (trim) { nc = nc.trim();} + nc = "'" + nc + "'"; + break; + case "CLOB": + nc = rs.getString(i).replace("'","''"); + if (trim) { nc = nc.trim();} + nc = "'" + nc + "'"; + break; + case "CHAR": + nc = rs.getString(i).replace("'","''"); + if (trim) { nc = nc.trim();} + nc = "'" + nc + "'"; + break; + case "DATE": + nc = "'" + rs.getString(i) + "'"; + if (nc == "'1/1/0001 12:00:00 AM'") { + nc = "NULL"; + } + break; + case "TIME": + nc = "'" + rs.getString(i).replace("'","''") + "'"; + break; + case "BIGINT": nc = rs.getString(i); - } - else { - nc = "NULL"; - } - break; + default: + if (rs.getString(i) != "") { + nc = rs.getString(i); + } + else { + nc = "NULL"; + } + break; + } } } if (i != 1){