JAVA v/s PL/SQL
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   omer_Imtiaz
Posted On:   Thursday, July 17, 2003 12:05 AM

Iam not sure whether this question belongs to this category or not, but since it doesnt relate to any particular API or feature directly, I ask it here. Scenario: Two Oracle 8i databases on same Unix HP machine. I have to import data from some of the tables in one database (DB1) and insert it into another one (DB2). Database structure are different and I have to do some complex processing as well, so using IMPORT utility wont help. Options: 1) Use JAVA (JDBC) to do this job 2) Use Pl/SQL to do the same job What I need to ask: What do u suggest regarding options keeping in mind: 1) the resulting application will consist of two par   More>>

Iam not sure whether this question belongs to this category or not, but since it doesnt relate to any particular API or feature directly, I ask it here.

Scenario:

Two Oracle 8i databases on same Unix HP machine. I have to import data from some of the tables in one database (DB1) and insert it into another one (DB2). Database structure are different and I have to do some complex processing as well, so using IMPORT utility wont help.

Options:

1) Use JAVA (JDBC) to do this job

2) Use Pl/SQL to do the same job

What I need to ask:

What do u suggest regarding options keeping in mind:

1) the resulting application will consist of two parts, one will do recreation (delete all records from DB2, and fetch again from DB1) and second will perform synchronization, one table in DB1 will keep information about the records to be synchronized.

2) second part (synchronizer) will run as a batch job, and will be scheduled.

thanx in advance for any help.

regards

Omer

   <<Less

Re: JAVA v/s PL/SQL

Posted By:   Stephen_McConnell  
Posted On:   Friday, July 18, 2003 05:56 AM

Seven or eight months ago, I would have said use Java and JDBC. But when the only tool you have is a hammer all problems look like a nail.


Since then, I've learned a lot of SQL and PL/SQL. If you plan to stay with the same database vendor (Oracle), then you probably should write the database replication feature in PL/SQL. It will be many many times faster (Your PL/SQL will execute in the DB as opposed to a JDBC call that has to make a new connection each time and runs inside a JVM)... There will be less moving parts... And PL/SQL has many features customized for Oracle Databases that make the tasks you want to do so much easier. Synchronization between two Oracle DBs is easier in PL/SQL...


You can have a Java (JDBC) program that fires the PL/SQL or does the controlling of several PL/SQL stored procedures. You can use JAVA to act as a synchronizer.


Good Luck


Stephen McConnell

About | Sitemap | Contact