-
1. Re: Configuring DataSource
alanmoor Jul 11, 2002 9:28 AM (in response to mukul)I have included my oracle-service.xml. It registers a jndi name of "jdbc/memberzDB". code to access:
ctx = new InitialContext();
Context me = (Context) ctx.lookup("java:comp/env");
ds = (DataSource)ctx.lookup("jdbc/memberzDB"); -
2. Re: Configuring DataSource
mukul Jul 11, 2002 12:56 PM (in response to mukul)Many Thanks Alan.
This works. The trick is the 2-step context lookup.
Otherwise the single lookup of :
"java:comp/env/jdbc/DataSource" always fails.
Thanks
Mukul -
3. Re: Configuring DataSource
camus Jul 11, 2002 11:09 PM (in response to mukul)Alan,
Are you able to get the data connection from the lookup datasource and use that connection to do database operations, like prepare statement, ? If so, could you post those examples of configuration files (*.xml) ?
I am suffering from the problem that I can't make use of the connection to do any database operations. It always says that the "connection handler is not currently associated with managedconnection".
I am sure that the connection is binded to the oracle server. Actually, it works in JBoss2.4.4, but when migrating to JBoss 3, it doesn't work. Any changes to the bean's code ?
Thanks in advance.