Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Tomcat and the fly likes Tomcat 6 DBCP Configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 6 DBCP Configuration" Watch "Tomcat 6 DBCP Configuration" New topic
Author

Tomcat 6 DBCP Configuration

Pradeep JD
Greenhorn

Joined: Oct 09, 2008
Posts: 6
I ma using tomcat 6. I want to configure database connection pool, If i use the below method it works fine
<Context path="/test">
<Resourcename="jdbc/test"
auth="Container"
type="com.ibm.db2.jcc.DB2SimpleDataSource"
factory="com.ibm.db2.jcc.DB2DataSourceFactory"
user="test"
password="Password!"
serverName="172.16.2.234"
databaseName="db2"
portNumber="2668"
driverType="4"
testOnBorrow="true"
url="jdbc:db2://172.16.2.234:2668/db2"/>
</Context>

But I need to make global.

I tried by giving the same under <GlobalNamingResources> without the context but it is not working.

Please suggest me whether it is possible to create DBCP without context ?
Bhaskar Rao
Greenhorn

Joined: Apr 25, 2005
Posts: 23
Hi,

There is a way of defining global datasources. By global do you imply being accessible to all web apps? I think you can achieve it by removing the 'Path' attribute from the <context> element. The Resources thus defined should be available to all the web apps.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

"Pradeep JD", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pradeep JD
Greenhorn

Joined: Oct 09, 2008
Posts: 6
Thank you Bhaskar Rao
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

"Pradeep JD" did you check the private message sent by sheriff
Bear?


SCJP, SCWCD.
|Asking Good Questions|
 
 
subject: Tomcat 6 DBCP Configuration
 
Similar Threads
Unable make database connection using JNDI with tomcat
registering a DB2 datasource in tomcat 5.5.4
JNDI and DB2
HELP! - TOMCAT WITH DB2 NOT WORK
Not Able to Deploy War Files in Tomcat 6