[jboss-user] [Beginners Corner] - Re: EJB3 on Oracle

kkangsar do-not-reply at jboss.com
Wed Feb 11 10:11:32 EST 2009


Thanks for your fast response.

I have configured the persistence.xml as below:


    <persistence-unit name="examplePersistenceUnit">
    	<jta-data-source>java:/OracleDS</jta-data-source>
    </persistence-unit>


and created Oracle database source (oracle-ds.xml) in deployed folder.

<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!--                                                                       -->
<!--  JBoss Server Configuration                                           -->
<!--                                                                       -->
<!-- ===================================================================== -->

<!-- $Id: oracle-ds.xml 23720 2004-09-15 14:37:40Z loubyansky $ -->
<!-- ==================================================================== -->
<!--  Datasource config for Oracle originally from Steven Coy             -->
<!-- ==================================================================== -->



  <local-tx-datasource>
    <jndi-name>OracleDS</jndi-name>
    <connection-url>jdbc:oracle:thin:@localhost:1521:wm</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>wm</user-name>
    wm
    <!-- 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) -->
      
         <type-mapping>Oracle9i</type-mapping>
      
  </local-tx-datasource>



Is it enough to link to oracle database?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209092#4209092

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209092



More information about the jboss-user mailing list