spring jdbc placement (oracle)

There are four main types: JDBC, DBCP data source,  C3P0 data source, and jndi data source that come with spring :

 

1. For the JDBC configuration that comes with spring, you only need to import the ojdbcjar package;

The xml file is configured as follows

 <bean id="dataSourceSpring"  class="org.springframework.jdbc.datasource.DriverManagerDataSource">    
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /> 
    <property name="url" value="jdbc:oracle:thin:@IP:端口:sid" /> 
    <property name="username" value="usrname" />    
    <property name="password" value="密码" /> 
  </bean>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326523452&siteId=291194637