• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

make a jdbc conecction pool from 0, using JSP, tomcat, mysql

 
Greenhorn
Posts: 5
IBM DB2 Mac OS X jQuery
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use case:

1.- generate 5 connectios...for all user
> login(JSP) <--> servlet doPost <---> Conn.java

Connection conn; <--(eg. Connection A)
private boolean inuse;
when search inuse = true
when finished inuse=false

> other user, login(JSP) <--> servlet Detect Connection A.inuse=false, then use it
without created other connection(use one from pool)

Reason:
I do not want to depend on the configuration of tomcat to the pool implementers

What do you recommend?

what are the best practices?

Best Regards
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure why you decided to place it in the "Features new in Java 7" forum. Trying the JDBC forum.

I best practice I know of is: don't reinvent the wheel. Use existing solutions.
 
Carlos Salazar
Greenhorn
Posts: 5
IBM DB2 Mac OS X jQuery
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm wrong and I did not find the option to move or remove the post.

I do not want to reinvent the wheel.

I have more control of the code,so, know where an error.
tomcat pool, I think a black box.
I think someone could give me some idea.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's designed to be a blackbox. You often don't need to know the internal workings of the pooling mechanism. But if you do you can always view the source code.
 
Carlos Salazar
Greenhorn
Posts: 5
IBM DB2 Mac OS X jQuery
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so as you say makes sense.
I will use the pool of tomcat.

but this brings me to another question,

are there other pool that can be used?
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course. For instance BoneCP, C3P0 and DBCP.
reply
    Bookmark Topic Watch Topic
  • New Topic