mirror of
https://github.com/vran-dev/databasir.git
synced 2025-08-09 10:24:41 +08:00
fix: cursor over limit when sync (#115)
This commit is contained in:
@@ -94,11 +94,15 @@ public class JdbcColumnMetaRepository implements ColumnMetaRepository {
|
||||
TableCondition tableCondition) throws SQLException {
|
||||
ResultSet result = meta.getPrimaryKeys(tableCondition.getDatabaseName(),
|
||||
tableCondition.getSchemaName(), tableCondition.getTableName());
|
||||
List<String> columns = new ArrayList<>();
|
||||
while (result.next()) {
|
||||
String columnName = result.getString("COLUMN_NAME");
|
||||
columns.add(columnName);
|
||||
try {
|
||||
List<String> columns = new ArrayList<>();
|
||||
while (result.next()) {
|
||||
String columnName = result.getString("COLUMN_NAME");
|
||||
columns.add(columnName);
|
||||
}
|
||||
return columns;
|
||||
} finally {
|
||||
result.close();
|
||||
}
|
||||
return columns;
|
||||
}
|
||||
}
|
||||
|
@@ -52,7 +52,9 @@ public class JdbcForeignKeyMetaRepository implements ForeignKeyMetaRepository {
|
||||
log.warn("warn: ignore foreign keys in " + databaseName + "." + tableName + ", " + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
keyResult.close();
|
||||
if (keyResult != null) {
|
||||
keyResult.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.warn("warn: close key result error " + databaseName + "." + tableName + ", " + e.getMessage());
|
||||
}
|
||||
|
Reference in New Issue
Block a user