Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP with Oracle / SQL

 
Siva Sivaraman
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Siva Sivaraman
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic