java check if sql table exists

Solutions on MaxInterview for java check if sql table exists by the best coders in the world

showing results for - "java check if sql table exists"
Sophia
28 Nov 2020
1DatabaseMetaData dbm = con.getMetaData();
2// check if "employee" table is there
3ResultSet tables = dbm.getTables(null, null, "employee", null);
4if (tables.next()) {
5  // Table exists
6}
7else {
8  // Table does not exist
9}