Regular expressions in JDBC

I have a java application that uses JDBC to interact with a database. I want to do a search based on a series of regex, however the application needs to be generic, we don't know if the database engine will be mysql, oracle, sql server, etc, but we're pretty sure it will be either mysql or oracle.

Will regexes restrict my application to a specific database, or can I use them without worrying about compatibility?

+1


a source to share


3 answers


, , :-). , , Oracle, MySQL, PostgreSQL MS-SQL - , . , .

, , SQL-.



.

+4




, MySQL Oracle POSIX ERE, MySQL REGEXP, Oracle REGEXP_LIKE, regular-expressions.info - Oracle ( MySQL , , ).



, , , .

+3




Yes, using non-standard SQL functions like regular expression search will restrict your application to a specific database.

As with slekse's suggestion, a good solution is to limit the use of non-standard SQL functions to one specific module. Then you only need to change this module if you change the DBMS.

+1


a source







All Articles