Re: [JBoss-user] Please Help... i have been working on this problem for 5 days

2001-04-28 Thread Toby Allsopp

Roman Brouk wrote:

 thanks for reply!  why isn't it a correct way to access Datasource?

I'll repeat the answer I gave in the mail addressed to me directly 
(please don't send mail directly to me and to the list).

See section 19.4 of the EJB spec and numerous discussions here on 
jboss-user.  Hint: java:comp/env/.

Toby.


 try{
 InitialContext jndiContext = new InitialContext();
 javax.sql.DataSource ds = (javax.sql.DataSource)
 jndiContext.lookup(java:/mySQLDS);
 con = ds.getConnection();
 }catch(Exception ex){
 System.out.println(Looking for DataSource:  +
 ex.getMessage());
 }
 
 
 I get message that mySQLDS is not bound.
 
 
 That's strange.  What you're doing isn't the correct way for an EJB to
 access a DataSource, but it should work.  Is this all using a single
 JBoss instance?  What does the JNDIView MBean tell you (i.e. go to port
 8082, find the JNDIView MBean, invoke the list operation)?


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Please Help... i have been working on this problem for 5 days

2001-04-27 Thread Roman Brouk

I am using BMP. The question is how to access DataSource that represents
connection pool.

on start up JBOSS says that [mySQLDS] XA Connection pool mySQLDS bound to
java:/mySQLDS [mySQLDS] .  I have entries in jboss.jcml.

But in entity bean which I retrieve from JNDI, when I get connection:

try{
InitialContext jndiContext = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)
jndiContext.lookup(java:/mySQLDS);
con = ds.getConnection();
}catch(Exception ex){
System.out.println(Looking for DataSource:  +
ex.getMessage());
}


I get message that mySQLDS is not bound.



ANY IDEAS?  THANKS for your time and help.

-ROMAN BROUK


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user