Where The Streets Have No Name

spring 2.5에서 mysql연결시 한글이 깨져서 입력될시 해결방법 본문

Developement/Java

spring 2.5에서 mysql연결시 한글이 깨져서 입력될시 해결방법

highheat 2011. 10. 5. 11:04

context-datasource.xml에서 datasource설정부분입니다.

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <!--<property name="url" value="jdbc:mysql://localhost:3306/com4"/> -->         
        <property name="url">
        	<value>
            <![CDATA[
            jdbc:mysql://localhost:3306/com4?useUnicode=true&characterEncoding=utf8
            ]]>
            </value>
        </property>        
        <property name="username" value="com4"/>
        <property name="password" value="com401"/>
 </bean>