wood burning stoves 2.0*
The moose likes JSP and the fly likes JSP with Oracle / SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP with Oracle / SQL" Watch "JSP with Oracle / SQL" New topic
Author

JSP with Oracle / SQL

Siva Sivaraman
Greenhorn

Joined: Sep 26, 2002
Posts: 17
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.
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
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.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Siva Sivaraman
Greenhorn

Joined: Sep 26, 2002
Posts: 17
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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSP with Oracle / SQL
 
Similar Threads
Does JSP with SQL Server on Windows Make Sense?
Author question: JDBC in Java Code.
Convert a project into JSP-Servlet
Career Opportunities
What time we will use oracle as a back-end?