This commit is contained in:
2019-04-08 10:11:47 +08:00
parent b67e616340
commit abc220eb35
10 changed files with 93 additions and 49 deletions

View File

@@ -42,17 +42,18 @@ public class DbSourceMysql implements DbSource {
Map row = new HashMap();
for (int i = 1; i <= count; i++) {
String columnTypeName = metaData.getColumnTypeName(i);
String columnName = metaData.getColumnName(i);
row.put(columnName, null);
//String columnName = metaData.getColumnName(i);
String columnLabel = metaData.getColumnLabel(i);
row.put(columnLabel, null);
if (rs.getObject(i) != null) {
switch (columnTypeName) {
case "DATETIME":
case "TIMESTAMP":
case "DATE":
row.put(columnName, rs.getTimestamp(i).getTime()); break;
row.put(columnLabel, rs.getTimestamp(i).getTime()); break;
default:
row.put(columnName, rs.getObject(i));
row.put(columnLabel, rs.getObject(i));
}
}
}