Add connection manager class. To use, replace "user" and "password" with the correct strings in context.xml and from within your class:

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