5 Replies Latest reply on Aug 11, 2004 4:16 PM by tony1929

    Connecting jboss-3.2.5 to Oracle 9i

    tony1929

      Is there a step by step guide to setting up JBoss so that it can connect to Oracle 9i.

      Also is there a tutorial in creating a CMP Enity Bean in JBoss.

      Thanks for any help

      Tony

        • 1. Re: Connecting jboss-3.2.5 to Oracle 9i
          aalmero

          to connect jboss to oracle 9i,
          1. copy


          <JBOSS_HOME>\docs\examples\jca\oracle-ds.xml(for datasource type connection) or <JBOSS_HOME>\docs\examples\jca\oracle-xa.xml(for xa type connection) to <JBOSS_HOME>\server\default\deploy

          2. update the file accordingly.
          3. copy oracle's jdbc driver to <JBOSS_HOME>\server\default\lib

          for creating CMP Entity Beans, you can refer to JBOSS documentation and samples.

          hth,
          aalmero



          • 2. Re: Connecting jboss-3.2.5 to Oracle 9i
            tony1929

            Thanks aalmero,

            Can you help me a little more :
            Not being an Oracle DBA type

            for this code :
            <connection-url>jdbc racle ci:@youroracle-tns-name</connection-url>
            or
            <connection-url>jdbc racle ci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>


            Where can I find my oracle-tns-name and servicename:

            And would you know what sql code goes in here:
            <!-- 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>


            Thanks again Tony

            • 3. Re: Connecting jboss-3.2.5 to Oracle 9i
              briana

              Try looking in the tnsnames.ora in the Oracle_Home\network\ADMIN directory or you can check with your DBA.

              • 4. Re: Connecting jboss-3.2.5 to Oracle 9i
                aalmero

                you can remove other entries as they are optional. consult your DBA for the ff:
                youroraclehost = can be the ip address of the oracle machine
                yoursid - system identifier
                username
                password



                <datasources>
                 <local-tx-datasource>
                 <jndi-name>OracleDS</jndi-name>
                 <connection-url>jdbc:oracle:thin:@youroraclehost:1521:yoursid</connection-url>
                 <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
                 <user-name>x</user-name>
                 <password>y</password>
                 </local-tx-datasource>
                </datasources>


                • 5. Re: Connecting jboss-3.2.5 to Oracle 9i
                  tony1929

                  Thanks everyone but still having problems, sorry I did not reply sooner, been of ill.

                  Tony