Created
May 1, 2019 09:08
-
-
Save corneliouzbett/db9df6b7d606b76cc18796606b2d1af1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Table createUniqueTable(Database db, String name, | |
List<ColumnBuilder> columns, | |
ResultSetMetaData md, | |
ImportFilter filter) | |
throws IOException, SQLException | |
{ | |
// otherwise, find unique name and create new table | |
String baseName = name; | |
int counter = 2; | |
while(db.getTable(name) != null) { | |
name = baseName + (counter++); | |
} | |
return new TableBuilder(name) | |
.addColumns(filter.filterColumns(columns, md)) | |
.toTable(db); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment