Creating oracle data-source for jboss

To create a data source for the Oracle JDBC driver, edit the jboss.jcml file which is located in the JBoss/conf/ directory. For example:
C:\\jboss\conf\catalina

There is one modification, and one addition to make to this file.

  1. Replace this entry:
        
    org.hsqldb.jdbcDriver

    With this entry:

        
    oracle.jdbc.driver.OracleDriver,org.hsqldb.jdbcDriver

  2. Add the following entry just below the that was just modified. Change the properties of the URL, JDBCUser, and Password to match your database configuration.
        <mbean code="org.jboss.jdbc.XADataSourceLoader"
    name="DefaultDomain:service=XADataSource,name=OracleDS">
    OracleDS

    org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl


    jdbc:oracle:thin:@rcleveng-sun:1521:RCLEVENG

    scott
    tiger
    0
    10

The first modification allows the Oracle JDBC driver to be loaded and thus registered with the JDBC DriverManager class.

The second modification creates a JDBC data source bound to the JNDI name of java:/OracleDS.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s