JBOSS 中oracle-ds.xml的配置模板
2014-11-05 10:00
197 查看
http://blog.csdn.net/bo_hai/article/details/6076979
JBOSS 中oracle-ds.xml的配置模板。
代码模版:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource -->
<!-- $Id: oracle-ds.xml 88948 2009-05-15 14:09:08Z jesper.pedersen $ -->
<!-- ==================================================================== -->
<!-- Datasource config for Oracle originally from Steven Coy -->
<!-- ==================================================================== -->
<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@10.28.10.37:1521:orcl</connection-url>
<!--
Here are a couple of the possible OCI configurations.
For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
<connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
or
<connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
Clearly, its better to have TNS set up properly.
-->
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>hadiantest</user-name>
<password>hadiantest</password>
<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>Oracle9i</type-mapping>
<min-pool-size>5</min-pool-size>
<max-pool-size>10</max-pool-size>
<idle-timeout-minutes>1</idle-timeout-minutes>
<track-statements/>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<new-connection-sql>select 1 from dual</new-connection-sql>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
</metadata>
</local-tx-datasource>
</datasources>
PS(Postscript):
上面只是一个Oracle的数据源配置模版,在%JBOSS_HOME%/docs/examples/jca目录下有着各种数据库的数据源配置模版,需要的从这里去找。
JBOSS 中oracle-ds.xml的配置模板。
代码模版:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource -->
<!-- $Id: oracle-ds.xml 88948 2009-05-15 14:09:08Z jesper.pedersen $ -->
<!-- ==================================================================== -->
<!-- Datasource config for Oracle originally from Steven Coy -->
<!-- ==================================================================== -->
<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@10.28.10.37:1521:orcl</connection-url>
<!--
Here are a couple of the possible OCI configurations.
For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
<connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
or
<connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
Clearly, its better to have TNS set up properly.
-->
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>hadiantest</user-name>
<password>hadiantest</password>
<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>Oracle9i</type-mapping>
<min-pool-size>5</min-pool-size>
<max-pool-size>10</max-pool-size>
<idle-timeout-minutes>1</idle-timeout-minutes>
<track-statements/>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<new-connection-sql>select 1 from dual</new-connection-sql>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
</metadata>
</local-tx-datasource>
</datasources>
PS(Postscript):
上面只是一个Oracle的数据源配置模版,在%JBOSS_HOME%/docs/examples/jca目录下有着各种数据库的数据源配置模版,需要的从这里去找。
相关文章推荐
- JBOSS 中oracle-ds.xml的配置模板。
- Hibernate配置文件模板(.cfg.xml)
- JBOSS jboss-log4j.xml文件中配置web工程日志
- jboss-web.xml 配置说明
- Ant的项目配置文件build.xml(使用jboss-4.2.3GA-jdk6.zip)
- 2.struts2配置文件Web.XML与Struts.XML模板详细说明
- jboss下通过配置log4j.xml实现web应用的日志
- Spring的配置文件模板(the basic structure of XML-based configuration metadata)
- ejb3.0数据源配置文件mysql-ds.xml oracle-ds.xml persistence.xml sqlserver-ds.xml
- 配置实现-自创html生成模板搭配xml获取数据无需写代码实现静态网站
- Myeclipse代码生成模板(xml配置文件)
- build.xml 配置文档模板:
- hibernate.cfg.xml 配置模板
- applicationContext.xml 配置模板
- Jboss的server.xml配置文件中Connector的属性address的作用
- Hibernate.cfg.xml配置文件模板及解析
- hibernate.cfg.xml 配置模板
- struts-config.xml 配置模板
- Jboss 连接池参数(-ds.xml)
- spring配置bean.xml头文件模板