I am using the Tomcat JDBC connection pool.
In a multi thread scenario, is it safe to use a static instance of the DataSource object?
This is how I am getting my connection when needed:
public static Connection getConnection() throws SQLException {
return datasource.getConnection();
}
After I run my querie(s) I make sure the close the connection.