简体   繁体   English

JDBC查询表名称不区分大小写吗?

[英]JDBC query table names case insensitive?

tl:dr; tl:dr; Is there a way to select table names case insensitive over JDBC? 有没有办法选择对JDBC不区分大小写的表名?

I try to extract all table names from a database over a JDBC connection. 我尝试通过JDBC连接从数据库中提取所有表名。 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. 但是,这将返回所有表,视图等。我只需要与模式匹配的前10个。 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% . 模式的情况很重要,如果模式为a% ,则无法找到表AAP

Is there an easy way to query table names over JDBC, without having to resort to database-specific code? 有没有一种简单的方法可以通过JDBC查询表名,而不必诉诸于数据库特定的代码?

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%. 如果您关闭数据库的区分大小写功能,那么我假设AAP会返回%。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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