I want to write an application to replication data in a database to other. But
I don't know how to capture all data change in a table when users insert, update or delete rows. Can I use Java to do it? Please help me.
You could use database triggers (check the Oracle documentation about them); here's just an example to illustrate what you could do using shuch a trigger. You should, of course, write code to perform job you need.
CREATE OR REPLACE TRIGGER TSK_SUS_AFTER_IUD AFTER DELETE OR INSERT OR UPDATE ON TSK_STAVKE_UTUZENJA_STECAJA FOR EACH ROW
IF DELETING THEN
UPDATE TSK_UTUZENJA_STECAJEVI SET GLAVNICA = GLAVNICA - :OLD.IZNOS WHERE US_ID = :OLD.US_ID;
ELSIF INSERTING THEN
UPDATE TSK_UTUZENJA_STECAJEVI SET GLAVNICA = GLAVNICA + :NEW.IZNOS WHERE US_ID = :NEW.US_ID;
ELSIF UPDATING THEN
UPDATE TSK_UTUZENJA_STECAJEVI SET GLAVNICA = GLAVNICA - :OLD.IZNOS + :NEW.IZNOS WHERE US_ID = :OLD.US_ID;
Replication is a free feature of all supported versions of Oracle Enterprise Edition (817, 920, 10g). Check it out; I really like it. There are also log scraper programs like Quest Shareplex and Datamirror iReflect, which capture redo log entries and apply them to the remote database - and unlike Oracle Standby Database these two programs allow all of your databases to be open in read/write mode.
If your "other" database is not Oracle, you can use Oracle Gateways to treat them like Oracle databases. For example, you can setup replication between Oracle and DB2, but if you want multi-master then the DB2 database must be version 8 or higher.
Yes. Look at Oracle's gateway products, also known as Heterogeneous Services. A trigger in Oracle can insert into Sybase, SQL Server, DB2, and other databases. You can also select (fetch) data back from SQL Server to Oracle.
I am not sure if the Gateway can be used to push data from SqlServer to Oracle. I've always used Oracle to control push and pull operations; never used SqlServer to control the transmission of data to Oracle.