Skip to content

Commit

Permalink
处理不标准的JdbcType转换.
Browse files Browse the repository at this point in the history
  • Loading branch information
nieqiurong committed Jun 1, 2024
1 parent 4207ee0 commit 71f954b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ public Map<String, Column> getColumnsInfo(String catalog, String schema, String
column.name = name;
column.primaryKey = primaryKeys.contains(name);
column.typeName = resultSet.getString("TYPE_NAME");
column.jdbcType = JdbcType.forCode(resultSet.getInt("DATA_TYPE"));
int dataType = resultSet.getInt("DATA_TYPE");
JdbcType jdbcType = JdbcType.forCode(dataType);
if (jdbcType == null) {
// 不标准的类型,统一转为OTHER
jdbcType = JdbcType.OTHER;
}
column.jdbcType = jdbcType;
column.length = resultSet.getInt("COLUMN_SIZE");
column.scale = resultSet.getInt("DECIMAL_DIGITS");
column.remarks = formatComment(resultSet.getString("REMARKS"));
Expand Down

1 comment on commit 71f954b

@nieqiurong
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.