日期:2014-05-16  浏览次数:20429 次

mysql 数据库插入乱码

?

在数据员的连接后面添加上编码的设置,解决乱码问题

??useUnicode=true&characterEncoding=latin1"

?

<data-sources>
<data-source key=
"oracleDB1" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property=
"driverClassName"
value=
"org.gjt.mm.mysql.Driver" />
<set-property property=
"url"
value=
"jdbc:mysql://localhost/struts?
????????????????useUnicode=true&amp;characterEncoding=latin1
" />??<2>
<set-property property=
"maxActive"
value=
"5"/>
<set-property property=
"username"
value=
"root"/>
<set-property property=
"password"
value=
"123456"/>
<set-property property=
"autoCommit"
value=
"true"/>
</data-source>
</data-sources>