Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

maintaining the database session  RSS feed

 
amrita sankar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

I am developing an application in jsp that needs to access the database.
For this i am using jdbc and in connection.jsp i am establishing the connection.
I need to access the database in each and every page....
So as of now i am including the connection.jsp in every page...
Can i maintain a connection session so that i dont need to open the connection.jsp in each and every page....
Any pointers to this or any tutorialfor this ???

Sankar
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are painting yourself into a corner of misery and pain.

Look into using a container-managed connection pool.

And for the love of heaven, keep the database access out of JSPs and in Java classes where it belongs.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!