Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Jdeveloper, JBoss and remote Database

719809Sep 28 2009 — edited Sep 28 2009
Hi,

We have developped an application with JDeveloper 10.1.3.4, that has a session bean with a local Interface. During our tests, the database (Oracle 9i) and the Application Server JBoss 4.0.5GA were on the same machine.We have generated an EAR file that runs well on Jboss Server.

Now, we have to be in a 3 tiers architecture, with a Database Server on a computer, and the Aplication Server Jboss on another one.

My question is : what must we change? May we create a remote Interface? How Jboss will access to the Remote DataBase?

The oracle-ds.xml config is :

<datasources>
<local-tx-datasource>
<jndi-name>Facade_J</jndi-name>
<connection-url>jdbc:oracle:thin:@Test:1521:DBTest</connection-url>
<!--
<use-java-context>false</use-java-context>
-->

<!--

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>userX</user-name>
<password>passwdX</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>
</metadata>
</local-tx-datasource>

</datasources>


and a part of the login-conf.xml :

<application-policy name="test_App">
<authentication>
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
flag="required">
<module-option name="dsJndiName">java:/Facade_J</module-option>
<module-option name="principalsQuery">
select usr_password from test_user where test_login=?
</module-option>
<module-option name="rolesQuery">
select test_role, 'Roles' from test_role where test_login=?
</module-option>
</login-module>
</authentication>
</application-policy>

</policy>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 26 2009
Added on Sep 28 2009
6 comments
1,889 views