Jeyasithar
Jeyasithar

Reputation: 535

Oracle to Postgresql migration issue in JDBC

I want to make an application which is developed by another developer up and running. When I set up the environment I got sql exception said bad sql grammer. I browsed through internet to get a solution for that. I found that the syntax is oracle native method. But I do not understand how it was working well in earlier days with postgresql.

SELECT * FROM hrms.teammember b, hrms.designationmaster e WHERE  b.designationid = e.designation_id(+);

Thanks in advance for your help.

Upvotes: 0

Views: 1655

Answers (3)

Jeyasithar
Jeyasithar

Reputation: 535

Finally I figured it out. The enterprisedb version advanced server with oracle compatibility software support these native oracle queries.

Upvotes: 2

Guillaume
Guillaume

Reputation: 5555

If you want to use Hibernate then you must migrate your application from direct JDBC use to Hibernate.

If you have a DB layer specific to postgresql you have no choice but to migrate it, either to Oracle (might be simpler in the short term but won't help you must change the DB again) or to an ORM like Hibernate (may be a bit more complex but you gain compatibility with most DB vendors).

Upvotes: 0

Jim Garrison
Jim Garrison

Reputation: 86754

If you are migrating from one dialect to another, you have only two choices:

  1. Modify the SQL
  2. Use an abstraction framework that can handle the modification on the fly

Since you do not want to use Hibernate, you are left with finding another database abstraction framework. You might do your own search for "java database abstraction layer" and examine the results to see if one will work for you.

Upvotes: 1

Related Questions