I need to concatenate two fields in an SQL statement, and I use the same statements for MySQL and SQLite in a Java application using JDBC.
It turns out that both MySQL and SQLite have different and incompatible concat statements:
So far I have managed to use the same sentence for both databases, so now I need either a way to find the concat statement independent of MySQL and SQLite; or detect dynamically in my Java application if the statement is executed in MySQL or SQLite.
I can also add a parameter to my Java method, the one that contains the SQL query, to find out if I'm using MySQL or SQLite, but I don't really like this last solution.
Do you have any ideas on how to create an independent concat statement? or any other idea whatsoever?
Thanks.
source share