I don't actually find any of the presented solutions here to be fully complete so I'll add my own. Nothing new here. You can stitch this together from the other presented solutions plus various comments.
There are at least two things you'll have to make sure:
Make sure you pass the table name to the getTables() method,
rather than passing a null value. In the first case you let the
database server filter the result for you, in the second you request
a list of all tables from the server and then filter the list
locally. The former is much faster if you are only searching for a
single table.
Make sure to check the table name from the resultset with an equals
match. The reason is that the getTables() does pattern matching on
the query for the table and the _ character is a wildcard in SQL.
Suppose you are checking for the existence of a table named
EMPLOYEE_SALARY. You'll then get a match on EMPLOYEESSALARY too
which is not what you want.
Ohh, and do remember to close those resultsets. Since Java 7 you would want to use a try-with-resources statement for that.
You may want to consider what you pass as the types parameter (4th parameter) on your getTables() call. Normally I would just leave at null because you don't want to restrict yourself. A VIEW is as good as a TABLE, right? These days many databases allow you to update through a VIEW so restricting yourself to only TABLE type is in most cases not the way to go. YMMV.