-
1. Re: EJB and database connection.
adrian.brock Jul 9, 2003 6:00 PM (in response to arupsarkar)A resource-ref in your deployment descriptors.
Regards,
Adrian -
2. Re: EJB and database connection.
arupsarkar Jul 10, 2003 3:32 PM (in response to arupsarkar)Thanks Adrian for replying, I do have a resource-ref in my ejb-jar.xml which is as follows.
<resource-ref>
<res-ref-name>java:/OracleDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref> -
3. Re: EJB and database connection.
raja05 Jul 10, 2003 5:21 PM (in response to arupsarkar)The initial error message says jdbc not bound, so its still loooking at java:comp/env/jdbc/OracleDS instead of java:/OracleDS which is the physical jndi name,
Did you compile all ur classes after changing from java:comp/env/jdbc/OracleDS to java:/OracleDS. I know its kinda stupid but just to make sure!!
Anyway, if you are using java:/OracleDS, you dont even need the resource-ref as you are using hte physical JNDI.
-Raj -
4. Re: EJB and database connection.
vashistvishal Jul 10, 2003 10:33 PM (in response to arupsarkar)In ejb-jar.xml
<resource-ref >
<res-ref-name>jdbc/OracleDS</res-ref-name>
<res-type>javax.sql.Datasource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
InJboss.xml
<resource-ref>
<res-ref-name>jdbc/OracleDS</res-ref-name>
<jndi-name>java:/OracleDSDS</jndi-name> </resource-ref>
This will work absolutely fine if you use this String to lookup.
"java:comp/env/jdbc/OracletDS"
but if your using "java:/OracleDS" to lookup then you will not require resource-ref-name tag in yr descriptors as pointed by raja in his posting.
I hope this will get you going. -
5. Re: EJB and database connection.
arupsarkar Jul 18, 2003 11:43 AM (in response to arupsarkar)Thanks Vishal,
I made the changes as you suggested, now I am getting the following error.
/************ error **********/
13:36:26,298 INFO [STDOUT] CustomerBean makeConnection
13:36:26,298 INFO [STDOUT] javax.ejb.EJBException: Unable to connect to databas
e. OracletDS not bound
13:36:26,308 INFO [STDOUT] Hello! I am Session Bean
/************ error **********/
I have also attached the piece where I made modification in my oracle-service.xml
- <depends optional-attribute-name="ManagedConnectionFactoryName">
- <!-- embedded mbean
-->
-
OracleDS
-
-
<config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@00.00.000.00:25466:D5791S</config-property>
- <!--
Here are a couple of the possible OCI configurations.
For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
<config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:oci:@youroracle-tns-name</config-property>
or
<config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</config-property>
Clearly, its better to have TNS set up properly.
-->
<config-property name="DriverClass" type="java.lang.String">oracle.jdbc.driver.OracleDriver</config-property>
- <!-- set these only if you want only default logins, not through JAAS
-->
<config-property name="scott" type="java.lang.String" />
<config-property name="tiger" type="java.lang.String" /> -
6. Re: EJB and database connection.
vashistvishal Jul 20, 2003 8:22 PM (in response to arupsarkar)Have a look at this thread,
http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= guess is yr url setting for conecting to oracle driver is wrong or may be you need more attributes in there.
I hope someone will be able to help you. -
7. Re: EJB and database connection.
vashistvishal Jul 20, 2003 8:27 PM (in response to arupsarkar)There is a another thread on 3.2.1
I am not sure what version you are using, because with 3.2.1 datasource config file has changed.
Have a look at this thead.
http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= -
8. Re: EJB and database connection.
arupsarkar Jul 21, 2003 1:28 PM (in response to arupsarkar)I was using jboss-3.0.6, now I am using jboss-3.2.1, I have modified oracle-ds.xml and put it in the jboss_insatll_dir/server/default/deploy, now I am getting the following error basically could not connect to the database.
"15:14:05,566 INFO [STDOUT] javax.ejb.EJBException: Unable to connect to databas
e. Table not found:"
Regards
Arup