0

I am literally new to JSF and web Dev.

I am creating a website that interact with a database. I have understood how to display the data from a table but currently I am creating a new connection everytime I change the table to display.

Isn't it better to create the connection at the beginning and close it at the end ?

How should I share the connection informations between the different classes that are using it to query the DB ?

Soji
  • 177
  • 1
  • 5
  • 17
  • Try to use a framework like Spring for managing that. There are many examples on that if you will look – Daniel Jipa Aug 20 '15 at 17:35
  • 1
    Enjoy creating a connection pool and gradually move to a (distributed) transaction management system like JTA. – Tiny Aug 20 '15 at 18:04

0 Answers0