上家公司用到的,今天无意中看到,整理并做一下记录,以备以后查看,同时也希望对有需要的朋友有所帮助。配置如下:
<?xml version="1.0" standalone='yes'?>
<!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://xmlns.oracle.com/ias/dtds/data-sources-9_04.dtd">
<data-sources>
<!--
An example/default DataSource that uses
Oracle JDBC-driver to create the connections.
This tag creates all the needed kinds
of data-sources, transactional, pooled and EJB-aware sources.
The source generally used in application code is the "EJB"
one - it provides transactional safety and connection
pooling. Oracle thin driver could be used as well,
like below.
url="jdbc:oracle:thin:@host:port:sid"
-->
<!--单数据库-->
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="OracleDS"
location="jdbc/orcl01"
xa-location="jdbc/xa/OracleXADS"
ejb-location="jdbc/OracleDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="scott"
password="tiger"
url="jdbc:oracle:thin:@127.0.0.1:1521:orcl"
inactivity-timeout="30"
/>
<!--数据库集群-->
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="OracleDS"
location="jdbc/orcl02"
xa-location="jdbc/xa/OracleXADS"
ejb-location="jdbc/OracleDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.2)(PORT = 1521))(LOAD_BALANCE = yes))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ORCL)(FAILOVER_MODE =(TYPE = SELECT)(METHOD = BASIC)(RETRIES = 30)(DELAY = 15))))"
username="scott"
password="tiger"
inactivity-timeout="30"
/>
</data-sources>