TheLoons / SportIM-service

Backend Webservice for SportIM
GNU General Public License v2.0
1 stars 0 forks source link

Create connection management class #5

Closed hjbrock closed 9 years ago

hjbrock commented 9 years ago

Create the connection management class including reading creds from a file.

hjbrock commented 9 years ago

ConnectionManager can be used to pull from the connection pool. Before starting up tomcat, make sure you replace "user" and "password" in context.xml with the appropriate values.

Then, in your classes you can:

    ConnectionManager cm = ConnectionManager.getInstance();
    Connection conn = cm.getConnection();
    ...
    conn.close();