I want to call getTables method of DatabaseMetaData and get all tables which names are not starting with "KB".
How can I do this?开发者_运维技巧 Thanks
As getTables()
accepts (only) standard SQL patterns for a LIKE
condition, I don't think this is possible.
Some DBMS violate (aka "extend") the SQL standard by allowing regular expressions for a LIKE
condition (I think SQL Server does this).
Check the manual for your DBMS what kind of expressions LIKE supports.
If it does support a regular expression you can try to use ^[^KB].*
as the filter condition for the table name parameter. But again this is non-standard and won't work on all DBMS.
精彩评论