Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Connection Pooling [closed]

Can someone tell me or point me to a document/tutorial that explains how to use connection pooling in Spring?

like image 462
Shyam Avatar asked Apr 22 '09 14:04

Shyam


2 Answers

Spring doesn't support inbuilt pooling. You should use a third party pool as mentioned above. DBCP and c3p0 both work like a charm with spring. All you need to do is when defining a datasource in your context.xml, just use DBCP to define it.

like image 71
Gaurav Avatar answered Oct 14 '22 08:10

Gaurav


You might use a pooled datasource from the jdbc driver. E.g. in oracles library there is one:

<bean id="dataSource"
    class="oracle.jdbc.pool.OracleConnectionPoolDataSource">
    <property name="URL" value="jdbc:oracle:thin:@wherever:1234:whatever" />
    <property name="user" value="theuser" />
    <property name="password" value="thepassword" />
</bean>
like image 35
Hans-Peter Störr Avatar answered Oct 14 '22 09:10

Hans-Peter Störr