简体   繁体   中英

JDBC query table names case insensitive?

tl:dr; Is there a way to select table names case insensitive over JDBC?

I try to extract all table names from a database over a JDBC connection. I can do this easily by

ResultSet tablesRst = connection.getMetaData().getTables( null, null, null, null );

This, however, returns ALL tables, views etc. I just need the first 10 that match a pattern. I know I can build this myself by manipulating the arguments.

The case of the pattern matters, I cannot find table AAP if the pattern is a% .

Is there an easy way to query table names over JDBC, without having to resort to database-specific code?

That probably depends on the database configuration. If you turn off case sensitivity on your database, I'm assuming AAP will come back for a%.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM