스프링에서 dataSource 빈 등록할 때 예시입니다.
1. MySQL
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="URL" value="jdbc:mysql://<hostname>:<port_num>/<DB>?characterEncoding=EUCKR"/> <property name="username" value="id"/> <property name="password" value="pwd"/> </bean>
2. Oracle
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> <property name="URL" value="jdbc:oracle:thin:@<hostname>:<port_num>/<SID>"/> <property name="username" value="id"/> <property name="password" value="pwd"/> </bean>