Jboss-4.2.3 GA
To configure the oracle datasource copied the oracle-ds.xml from jboss-as\docs\examples\jca folder to jboss-as\server\default\deploy folder and updated following info highlighted red
<jndi-name>
TestOracleDatasource</jndi-name>
<connection-url>
jdbc: o racle:thin:@
youroraclehost:1521:yoursid</connection-url>
<driver-class>oracle.jdbc.driver . O racleDriver</driver-class>
<user-name>
x</user-name>
<password>
y</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor . O racleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
And following code is used to lookup the datasource
InitialContext context = new InitialContext();
DataSource ds = (DataSource) context.lookup("java:/comp/env/jdbc/TestOracleDatasource");
if (con == null)
{ con = ds.getConnection();
System.out.println("----con 1---->"+con.getMetaData().getIdentifierQuoteString());
System.out.println("----con 2---->"+con.getMetaData().getUserName());
System.out.println("----con 3---->"+con.getMetaData().getURL());
System.out.println("----con 4---->"+con.getMetaData().getDriverName());
}
here is what it printed in the logs
INFO [STDOUT] ----con 1---->"
01:45:55,842 INFO [STDOUT] ----con 2---->SA
01:45:55,842 INFO [STDOUT] ----con 3---->jdbc:hsqldb:C:\seamsetup\jboss-4.2.3.GA\server\default\data\hypersonic\localDB
01:45:55,842 INFO [STDOUT] ----con 4---->HSQL Database Engine Driver
I am sure the above details are from server/deploy/hsqldb-ds.xml, and I noticed several forums mentioneing HSQL DB is the default datasource.
So how do we change the default datasource from HSQL DB to Oracle. What configuration we need to change ?
Thanks
Amar.