Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
v-kkhuang committed Oct 25, 2023
1 parent 99a8128 commit 47e0d02
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public List<MetaColumnInfo> getColumns(String database, String table)
ResultSet rs = null;
ResultSetMetaData meta = null;
try {
List<String> primaryKeys = getPrimaryKeys(getDBConnection(connectMessage, database), table);
ps = conn.prepareStatement(columnSql);
ps.setString(1, database);
ps.setString(2, table);
Expand All @@ -143,6 +144,9 @@ public List<MetaColumnInfo> getColumns(String database, String table)
info.setIndex(i);
info.setName(meta.getColumnName(i));
info.setType(meta.getColumnTypeName(i));
if (primaryKeys.contains(meta.getColumnName(i))) {
info.setPrimaryKey(true);
}
columns.add(info);
}
} finally {
Expand Down

0 comments on commit 47e0d02

Please sign in to comment.