Thanks for the help with getting me on the list.
 
Actually, 
 
I've got 2 separate web applications that need to get connections from the same 
DataSource pointing to the same database, so I would like it to be global so that both 
wars can see it, as opposed to having to configure 2 separate connection pools with 
different names pointing to the exact same database.
 
Amarish

"Shapira, Yoav" <[EMAIL PROTECTED]> wrote:

Hi,
Welcome to the list, finally ;)

Why do you need to move it to the GlobalNamingResources?

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Toby Tittles [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 26, 2004 4:14 PM
>To: [EMAIL PROTECTED]
>Subject: ResourceLink to JNDI DataSource in GlobalResources not working
>
>
>Hi There, I'm running Tomcat 4.1.30. When I put the Resource and
>ResourceParams elements in the Context element of my webapp, it seems
to
>work fine, but when I move it to the GlobalNamingResources element and
>point to it using a ResourceLink, it doesn't seem to work giving me an
>exception saying that the driver class is null. Here's my Resource in
the
>GlobalNamingResources: >scope="Shareable" type="javax.sql.DataSource" />
> 

>factory
>org.apache.commons.dbcp.BasicDataSourceFactory
>
 
driverClassName
>oracle.jdbc.driver.OracleDriver 



>url jdbc:oracle:thin:@MY_DB_URL
>
 
username
>MY_USER_NAME 


>password
> MY_PASSWORD 


>maxActive 30 



>maxIdle 10 


>maxWait 60000 



>removeAbandonedTimeout 60


>
 logAbandoned true
>
 And here's my ResourceLink nested in my
>Context: >global="jdbc/myoracle"
type="javax.sql.DataSource"/>
>
>Here's my entry in my web.xml
>
> 
> DB Connection
> jdbc/myoracle
> javax.sql.DataSource
> Container
> 
>
>and here's my java code to get a connection
>
>
>Context ctx = new InitialContext();
>
>
>
>
>
>Object obj = ctx.lookup("java:comp/env/jdbc/myoracle");
>
>DataSource ds = (DataSource)obj;
>
>
>
>return ds.getConnection();
>
>
>Like I mentioned, the code works when the resource is nested inside
>
>the context, but when I replace it with the resource link like above
>
>and move it up to the global naming resources, it doesn't work.
>
>Any suggestions?
>
>
>
>---------------------------------
>Do you Yahoo!?
>Friends. Fun. Try the all-new Yahoo! Messenger



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged. This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else. If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender. Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

                
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

Reply via email to