Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 6 DBCP Configuration

 
Pradeep JD
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Pradeep JD", please check your private messages for an important administrative matter.
 
Pradeep JD
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bhaskar Rao
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Pradeep JD" did you check the private message sent by sheriff
Bear?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic