wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes ejb's for multiple db Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ejb Watch "ejb New topic
Author

ejb's for multiple db

shivahire
Greenhorn

Joined: Mar 05, 2001
Posts: 2
Hi ,
We r in process of developing a product using J2EE platform. The core requirement is that my product should work for any underlying database(db). For discrepancy in few functions and keywords in various db we r not building the query in EJB directly. We r sending the broken form of query like criterias for search where in some support classes are used to
1) check the underlying instance of database
2) translate the functions(like max to maximum) which r db generic to specific db.
3) build the sql using a query builder and fire the query and get back the results to ejb.
I strongly feel its a very crude path. Is there any other way to do this? I have read about JDBC type 3 driver, which does all these magic for us. Kindly contribute ur i/p on this issue.
bye,
Shiva
schennamaraja
Greenhorn

Joined: Mar 06, 2001
Posts: 2
one way you can do is write a query builder factory, which instantiates the appropriate querybuilder (oracle, sysbase,sqlserver).
let the querybuilder run the sql and return the resultset to the calling bean, and the bean can wrap the resultset in a serializable fashion (ResultSet is not serializable) and sent back to the client.
we did similar to that as we had to get the data in chunks....
hope this helps...

you can write
Originally posted by shivahire:
Hi ,
We r in process of developing a product using J2EE platform. The core requirement is that my product should work for any underlying database(db). For discrepancy in few functions and keywords in various db we r not building the query in EJB directly. We r sending the broken form of query like criterias for search where in some support classes are used to
1) check the underlying instance of database
2) translate the functions(like max to maximum) which r db generic to specific db.
3) build the sql using a query builder and fire the query and get back the results to ejb.
I strongly feel its a very crude path. Is there any other way to do this? I have read about JDBC type 3 driver, which does all these magic for us. Kindly contribute ur i/p on this issue.
bye,
Shiva

Matt Midcap
Sheriff

Joined: Jan 07, 1999
Posts: 440
"shivahire" & "schennamaraja"
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.
Thanks, and thank you for your contributions to the forums!


Best Regards,<br />Matt Midcap
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb's for multiple db