spring jdbcTemplate 配置
时间:2021-07-01 10:21:17
帮助过:12人阅读
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"
2 destroy-method="close"
abstract="false" lazy-init="default" autowire="default">
3 <property name="driverClass">
4 <value>oracle.jdbc.driver.OracleDriver</value>
5 </property>
6
7 <property name="jdbcUrl">
8 <value>jdbc:oracle:thin:@192.168.31.18:1521:orcl</value>
9 </property>
10 <property name="user">
11 <value>rensheju</value>
12 </property>
13 <property name="password">
14 <value>123</value>
15 </property>
16
17 <property name="maxPoolSize">
18 <value>5</value>
19 </property>
20 <property name="minPoolSize">
21 <value>1</value>
22 </property>
23 <property name="initialPoolSize">
24 <value>1</value>
25 </property>
26 </bean>
27
28
29
30
31
32 <bean id="jdbcTemplate"
33 class="org.springframework.jdbc.core.JdbcTemplate">
34 <property name="dataSource">
35 <ref local="dataSource" />
36 </property>
37 </bean>
@Autowired
public JdbcTemplate jdbcTemplate;
spring jdbcTemplate 配置
标签:driver name pre word pass temp com style 配置