Muhammad Hewedy
Muhammad Hewedy

Reputation: 30058

How to filter tables using Connection.getMetaData().getTables

I have a huge schema that contains my application table, I need to return these tables only.

I've used the following:

ResultSet publicTables = jdbcConnection.getMetaData().getTables(null, schema, "USER_%", dataTypes);

The problem is, I've 6 tables started by the USER_ keyword and two other arbitrary table names, how can I add OR filter for these two tables?

Upvotes: 2

Views: 1388

Answers (1)

user330315
user330315

Reputation:

That's not possible. You will need to call getTables() several times (one call for each search expression)

Upvotes: 1

Related Questions