Ling Chen wrote:

>Hi Wayne,
>
>After I changed the code to
>
>
>
>>Context context = new InitialContext();
>>context.lookup("java:comp/env/jdbc/ds1");
>>
>>

>
>I still cannot connect to the datasource, the exception is:
>------------
> RemoteException occurred in server thread; nested exception is:
>java.rmi.RemoteException: ; nested exception is:
>javax.ejb.EJBException: Unable to connect to database. Exception
>occurred while the JNDI NamingManager was processing a
>javax.naming.Reference object.
>------------
>
>The settings I have in the Studio are:
>
>Under the server setting, I have
> "ds1" ( name )
> "jdbc/ds1" (JNDI name)
>for a Cloudscape JDBC Driver datasource.
>
>Under the session bean's setting, I added a ResourceRef to the data
>source:
> "jdbc/ds1" (name)
> "javax.sql.DataSource" (type)
> "Container"(Authentication)
> "Shareable"(Sharing scope)
> "jdbc/ds1"(JNDI name)
>I didn't specify anything under WebSphere Extensions.
>
>If you are able to connect to a jdbc datasource from a EJB using jndi
>lookup, please let me know.
>
>Thanks,
>Ling
>
>

It looks like you ARE connecting to the datasource. Which can't connect
to the database.

Ken