Skip to content

Commit 862db09

Browse files
committed
fix: better table exists implementation
1 parent 1743b20 commit 862db09

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • src/main/java/com/code/advancedsql/table

src/main/java/com/code/advancedsql/table/Table.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public boolean exists() throws SQLException {
2626

2727
ResultSet tables = metaData.getTables(null, null, this.name, null);
2828

29-
return tables.next();
29+
String name = tables.getString("TABLE_NAME");
30+
31+
return tables.next() && name != null && name.equals(this.name);
3032
}
3133

3234
@Override

0 commit comments

Comments
 (0)