Hi, Current project : JSP / Oracle database. New requirement : JSP / SQL server Problem : Oracle queries not compatible to SQL Server. Question: What is the best way to solve this in the java bean? Solution 1 : Maintain two packages 1.Oracle 2.SQL Server Solution 2 : Maintain single pacakge with if / else statement for Oracle and SQL Server queries. We need to maitain the code in both Oracle and SQL Server for all later versions of this project. Any help in deciding the best approach is appreciated.
I'd treat this the same as any internationalization/localization issue: Load your SQL from a resource bundle at runtime, depending on which database you are connecting to. Or alternatively, consider EJB-CMP which should take care of all that stuff for you.
I was considering this solution but didn't know how to implement this in the javabean.I have implemented Internationalization in the jsp pages using the resource bundles. If we have 2 set of resource bundle, one for Oracle and other for SQL, how to implement this in the calling java bean?