File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
flyway-dialect/src/main/java/tech/ydb/flywaydb/database Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 11package tech .ydb .flywaydb .database ;
22
3+ import java .sql .DatabaseMetaData ;
34import java .sql .ResultSet ;
45import java .sql .SQLException ;
56import java .util .ArrayList ;
67import java .util .List ;
78import java .util .stream .Collectors ;
9+
810import org .flywaydb .core .internal .database .base .Schema ;
911import org .flywaydb .core .internal .jdbc .JdbcTemplate ;
1012
@@ -75,15 +77,13 @@ public String toString() {
7577 }
7678
7779 private List <String > schemaTables () throws SQLException {
78- ResultSet rs = jdbcTemplate .getConnection ().getMetaData ()
79- .getTables (null , name , null , new String []{"TABLE" });
80-
81- List < String > tables = new ArrayList <>();
82-
83- while ( rs . next ()) {
84- tables . add ( database . quote ( rs . getString ( "TABLE_NAME" ))) ;
80+ DatabaseMetaData md = jdbcTemplate .getConnection ().getMetaData ();
81+ try ( ResultSet rs = md .getTables (null , name , null , new String []{"TABLE" })) {
82+ List < String > tables = new ArrayList <>();
83+ while ( rs . next ()) {
84+ tables . add ( database . quote ( rs . getString ( "TABLE_NAME" )));
85+ }
86+ return tables ;
8587 }
86-
87- return tables ;
8888 }
8989}
You can’t perform that action at this time.
0 commit comments