Now I am using something like:
dbResult = dbStatement.executeQuery("SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '[e2]' AND table_name = '[emp101_messages]'");
while(dbResult.next())
{
int value = -1;
value= dbResult.getInt(1);
System.out.println(value + " table count");
}
Is this correct way to check if a table exists in a database?
As most of the options are already provided. Please see if this can help.