*
The moose likes JDBC and the fly likes Moving from Oracle to DB2 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 » Databases » JDBC
Bookmark "Moving from Oracle to DB2" Watch "Moving from Oracle to DB2" New topic
Author

Moving from Oracle to DB2

Dinesh Ramakrishnan
Greenhorn

Joined: Dec 04, 2006
Posts: 14
All,

We currently have our web application certified on SQL server 2005 and Oracle 9i/10g. The data layer of the application is built on hibernate layer and also plain JDBC calls with direct SQL's.

Do we know of any issues if we go against DB2 database? I understand Hibernate supports DB2 as well but wanted to check for any known issues.

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Hibernate supports DB2 so that aspect should be OK without any changes (though you don't say which version of DB2 - DB2 390 is a very different beast). The only issue is your direct SQL. Typically, direct SQL is used in circumstances where the logic is too specialized to use Criteria or HQL so its probably going to be an issue. But assuming you've made judicious use of a DAO pattern it shouldn't be a massive job to work round.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

My last job used DB2 390 :(

Other than what Paul mentioned, the only other non-manually-coded-SQL issue might be with primary keys, but whether or not that's an issue depends on how you've defined them.
Dinesh Ramakrishnan
Greenhorn

Joined: Dec 04, 2006
Posts: 14
Can I know whats the issue with direct SQL's. We use direct SQL's mostly for read-only queries and I thought could modify the queries if for any Oracle specific keywords

Also David you mentioned about Primary key concern. I found both Primary Key and Unique key definition in DB2. Can you detail on this issue?

Thanks very much
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30050
    
149

Dinesh Ramakrishnan wrote:Can I know whats the issue with direct SQL's. We use direct SQL's mostly for read-only queries and I thought could modify the queries if for any Oracle specific keywords

This is the problem - that Oracle specific syntax creeps into hand coded queries. Like Oracle's rownum, vs db2's fetch first. Depending how many queries you have, this could be a lot of work to change.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Moving from Oracle to DB2
 
Similar Threads
Passing collections to stored procedures in DB2
Hibernate configuration issue with DB2Dialect
Does �Hibernate� provide these features?
web application slow
[Hibernate Query] Slow performance with Oracle as compared to MySQL