• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection pooling

 
Cristian Popovici
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day people,

I have one question:
How can I define a database connection pooling with Tomcat that can be used by multiple applications?

Have a great day,
Cris.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
 
Maurizio Nagni
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use either the admin console or edit by hand the server.xml file and add something like into the <GlobalNamingResources> tag




now, from your application(s) you can call the connection using a code like



obviously if you do not use Mysql you need to change the driver and the url format.
 
Cristian Popovici
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible if is defined in the GlobalNamingResources ?

Thanks for the help.
Cris.
 
Cristian Popovici
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your help!

Cheers.
 
Cristian Popovici
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this error:

Name jdbc is not bound in this Context

Any idea why?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like the datasource is bound to jdbc/passport. So try using:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic