We should not use DriverManager database because it doesn't actually pool the connection more ever it creates a new connection for every new ds.getConnection all stead of using existing Connection.
Don't use single connection data source because it creates one connection uses it for all requests this is very bad in web environment because when multiple requests are coming simultaneously if any simultaneous request call con.rollback method the other simultaneous requests related persistence operation will be Rolled Back because they are also using same connection.
If your Project is standalone app running outside the server then use Third Party Connection Pool software like Apache DBCP , c3p0.....etc.
If your project is deploy web application in server then use Server Manager JDBC Connection.
Follow @coder_mohit
Tweet to @coder_mohit
Don't use single connection data source because it creates one connection uses it for all requests this is very bad in web environment because when multiple requests are coming simultaneously if any simultaneous request call con.rollback method the other simultaneous requests related persistence operation will be Rolled Back because they are also using same connection.
If your Project is standalone app running outside the server then use Third Party Connection Pool software like Apache DBCP , c3p0.....etc.
If your project is deploy web application in server then use Server Manager JDBC Connection.