How to do: Oracle Connection Pooling in Spring

There lies a plethora of database connection pooling frameworks in the industry like Apache DBCP, C3P0, BoneCP etc., for Oracle Database.  Based on my technical experience I would say The Oracle Connection pooling is the numero uno in its category and no second thought on it.

Here you go – Defining data source bean in  ApplicationContext

That’s it. Refer the oracleDataSource bean to Hibernate.

Sample definition of dataSource in Hibernate

Recommend for production purpose!

Properties of OracleConnectionPoolDataSource

ConnectionCacheName, ConnectionCacheProperties, ConnectionCachingEnabled, ConnectionProperties, PortNumber, ServerName, ServiceName
DatabaseName, DataSourceName, Description, DriverType, ExplicitCachingEnabled, FastConnectionFailoverEnabled, TNSEntryName, URL, User
ImplicitCachingEnabled, LoginTimeout, LogWriter, MaxStatements, NetworkProtocol, ONSConfiguration, Password