Friday, July 24, 2009

How to configure a Jboss Datasource?

Configuring a Datasource in Jboss very easy
Step 1: copy the original oracle-ds.xml from $jboss-home\docs\examples\jca\oracle-ds.xml to
$jboss-home\server\default\deploy\
Step 2: modify the XML file as follows
<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@IP:PORT:SID</connection-url>
<use-java-context>false</use-java-context>
<!-- this is required if u want to connect to DB remotely from Main method-- >
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>user</user-name>
<password>password</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<query-timeout>60</query-timeout>

<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>

Step 3. Drop the JDBC driver jar into Jboss classpath (easiest approach - drop the jar file in to /server/default/lib)

No comments:

Post a Comment

Create ElasticSearch cluster on single machine

I wanted to figure out how to create a multi-node ElasticSearch cluster on single machine. So i followed these instructions First i did...