<!-- JDBC -->
<mbean
code="org.jboss.jdbc.JdbcProvider"
name="DefaultDomain:service=JdbcProvider">
<attribute
name="Drivers">oracle.jdbc.driver.OracleDriver</attribute>
</mbean>
<mbean
code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=OracleDB">
<attribute
name="PoolName">OracleDB</attribute>
<attribute
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
<attribute
name="URL">jdbc:oracle:thin:@localhost:1521:ORACLE</attribute>
<attribute
name="JDBCUser">scott</attribute>
<attribute
name="Password">tiger</attribute>
</mbean>
NB this file is in the %JBOSS_HOME%/conf/tomcat if you are using jboss with tomcat
3) Instantiate a Datasource class.
InitialContext jndiContext = new InitialContext();
javax.sql.DataSource source =
(javax.sql.DataSource)jndiContext.lookup("java:/OracleDB");
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jord Sonneveld
Sent: 10 July 2001 22:17
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] trying to look up a datasource what am i doing wrong?I have in jboss.jcml:
<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=Oracle">
<attribute name="PoolName">Oracle</attribute>
etc. etc. etc.
</mbean>In my bean code, I do:
DataSource ds;
ds=(DataSource) ( ( new InitialContext() ).lookup("java:/Oracle") );What is the exception that you get?
-----Original Message-----
From: Larry Kim [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 10, 2001 5:07 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] trying to look up a datasource what am i doing
wrong?
this is my client:
try
{
InitialContext initialContext = new InitialContext();
Object ref = initialContext.lookup( "DefaultDS"); // i have also
tried "java:/DefaultDS"
//that line causes an exception. I also tried://DataSource ds = (DataSource)PortableRemoteObject.narrow(ref,
DataSource.class);
//DataSource datasource = (DataSource)
initialContext.lookup("java:/DefaultDS");
}
catch (NamingException ne)
{
System.out.println("monster Booooyaaa!!! :( :( :(");
System.out.println(ne);
}
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user