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 1
1
package tech .ydb .flywaydb .database ;
2
2
3
+ import java .sql .DatabaseMetaData ;
3
4
import java .sql .ResultSet ;
4
5
import java .sql .SQLException ;
5
6
import java .util .ArrayList ;
6
7
import java .util .List ;
7
8
import java .util .stream .Collectors ;
9
+
8
10
import org .flywaydb .core .internal .database .base .Schema ;
9
11
import org .flywaydb .core .internal .jdbc .JdbcTemplate ;
10
12
@@ -75,15 +77,13 @@ public String toString() {
75
77
}
76
78
77
79
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 ;
85
87
}
86
-
87
- return tables ;
88
88
}
89
89
}
You can’t perform that action at this time.
0 commit comments