I don't believe that datasources are available in the global JNDI
namespace.  IIRC, they are only available in the java:comp/env/jdbc context
(only from EJBs).

---
Michael R. Maraya

> ----------
> From:         Larry Kim[SMTP:[EMAIL PROTECTED]]
> Reply To:     [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
> 

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

Reply via email to