AtomikosDataSourceBean数据源的配置

Configuring Oracle

Changed by WoutSteurs on 19 Mar 2010 - 05:38 - r10

  • AtomikosDataSourceBean example
  • Notes

AtomikosDataSourceBean example

 

AtomikosDataSourceBean ds = new AtomikosDataSourceBean();
ds.setUniqueResourceName("oracle");
ds.setXaDataSourceClassName("oracle.jdbc.xa.client.OracleXADataSource");
Properties p = new Properties();
p.setProperty ( "user" , "java" );
p.setProperty ( "password" , "java" );
p.setProperty ( "URL" , "jdbc:oracle:thin:@localhost-xe:1521:XE" );
ds.setXaDataSourceProperties ( p );

Notes

Oracle 9.2 and Oracle 10 are both working fine. It is highly recommended to use the latest Oracle 10 JDBC driver even when connecting to Oracle 9 databases.

Oracle's DBMS must be configured with extra packages before you can use it with XA:

 

grant select on sys.dba_pending_transactions to ;
grant select on sys.pending_trans$ to ;
grant select on sys.dba_2pc_pending to ;
grant execute on sys.dbms_system to ;

Also see here: Configuring Oracle for XA

你可能感兴趣的:(Oracle/MySQL等,数据库,java)