Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDBC connection in page constructor

GadoJun 1 2016

Hello Experts,

My app has 2 jsp pages the login page and the main page with multiple tabs in it which is the entire app.

In the main page i have to connect to the database to get the allowed user tabs so i put a jdbc connection method and called it in the constructor of the mainpage ... then i binded each tab's disabled parameter to a variable in the mainpage.java.

Now it works fine when the page loads it gets the allowed tabs and disables the rest.

The problem is that every time i click on a tab or open a panel box inside a tab that method in the constructor is invoked which couses the entire app to crash ... it gives me a PoolLimitSQLException error after going through the components a couple of times.

When i remove it from the constructor everything just runs fine.

Would you please tell me where exactly did i went wrong here and how should i fix it.

Thanks for your time.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 29 2016
Added on Jun 1 2016
0 comments
570 views