• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting connection from stateless session bean in borland application server  RSS feed

 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I m using borland Application Server
which cretaes two xml files while deploying
ejb-jar.xml
and ejb-inprise.xml
It provides wizard for getting connection through entity beans
and makes the followin entries in
ejb-inprise.xml
<entity>
<ejb-name>Customer</ejb-name>
<bean-home-name>Customer</bean-home-name>
<resource-ref>
<res-ref-name>jdbc/DataSource</res-ref-name>
<jndi-name>DataSource</jndi-name>
</resource-ref>
and
<datasource-definitions>
<datasource>
<jndi-name>DataSource</jndi-name>
<url>jdbc dbc:Gaurav</url>
<username>javateam</username>
<password>password</password>
<driver-class-name>sun.jdbc.odbc.JdbcOdbcDriver</driver-class-name>
</datasource>
</datasource-definitions>
i changed this xml by adding
<session>
<ejb-name>InvoiceProcessSL</ejb-name>
<bean-home-name>InvoiceProcessSL</bean-home-name>
this----> <resource-ref>
is --><res-ref-name>jdbc/DataSource</res-ref-name>
the added---><jndi-name>DataSource</jndi-name>
code----> </resource-ref>
</session>

Now in any of the business method of my session bean (stateless)
I try to get a connection to the database
like
javax.sql.Datasource ds;
java.sql.Connection con = ds.getConnection
but i m not getting connection
if the same thing is done using BMP and entity bean wizard
then the same code gets you the connection for BMP as well as CMP beans
can anyone suggest me as to where i might be wrong
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!