2 Replies Latest reply on Oct 28, 2005 4:01 PM by dvohra21

    CONNECTION TO ORACLE BY JBOSS

    462956
      HI
      this is the first time in your forum
      i have a problem to connect my webapp from my localmachine with jboss 3.2.3 to oracle database 9i which is on server machine. I have the oracle client, i think i am using the rigth url connection but i dont know why i can not see my servlteswhen i am give the server ip and it is running when i give my localhost ip. In order to be more clear on my local machine i am using postgres database but it is necessary to see the server database.

      thanks
        • 1. Re: CONNECTION TO ORACLE BY JBOSS
          Olaf Heimburger-Oracle
          Simply use the JDBC Thin type URL in your DataSource configuration. IP numbers as well as fully qualified host names work.

          Eg: jdbc:oracle:thin:@192.168.0.1:1521:ORCL
          • 2. Re: CONNECTION TO ORACLE BY JBOSS
            dvohra21
            To configure JBoss with Oracle dataabse.

            1. Copy Oracle's JDBC driver .zip file /jdbc/lib/classes12.zip to the server/default/lib directory.
            2. Copy /docs/examples/jca/oracle-ds.xml , to /server/default/deploy dir.

            3. In the oracle-ds.xml file set the <driver-class/> and <connection-url/> settings
            Class: oracle.jdbc.driver.OracleDriver
            URL: jdbc:oracle:thin:@<host>:<port>:<database>

            In the Connection URL setting, <host> is the HOST value specified in the /network/ADMIN/tnsnames.ora file, and <port> is the PORT value specified in the tnsnames.ora file, and <database> is the database name.

            4.
            Modify the standardjbosscmp-jdbc.xml configuration file, setting the <datasource> and <datasource-mapping> elements to use Oracle:

            <jbosscmp-jdbc>
            <defaults>
            <datasource>java:/OracleDS</datasource>
            <datasource-mapping>Oracle9i</datasource-mapping>
            </defaults>
            </jbosscmp-jdbc>
            5.
            Modify login-config.xml to use Oracle. Add the following <application-policy> element to login-config.xml:

            <application-policy name = "OracleDbRealm">
            <authentication>
            <login-module code =
            "org.jboss.resource.security.ConfiguredIdentityLoginModule"
            flag = "required">
            <module-option name = "principal">sa</module-option>
            <module-option name = "userName">sa</module-option>
            <module-option name = "password"></module-option>
            <module-option name ="managedConnectionFactoryName">
            jboss.jca:service=LocalTxCM,name=OracleDS
            </module-option>
            </login-module>
            </authentication>
            </application-policy>