When data is written to the mysql database, the database question mark Chinese garbled situation ??

When data is written to the mysql database, the database question mark Chinese garbled situation ??

When data is written to the database set up in the framework of ssm, the console can be printed Chinese, Chinese ?? situation occurred when writing to the database, the following is a workaround:

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
		<property name="url" value="jdbc:mysql://localhost:3306/personalmanagement?useUnicode=true&amp;characterEncoding=UTF-8">
		</property>
		<property name="username" value="root"></property>
		<property name="password" value="root"></property>
	<!-- 运用spring继承集成的jdbc,所以说引入spring-jdbc 的jar包,就可以通过上面的方式来连接数据
	库配置dataSource也为mybatis的核心对象sqlSessionFactory做准备 -->
</bean>

In the configuration file will modify the database connection information, plus:
? UseUnicode to true = = UTF-8 & characterEncoding

If you have questions, please point out
that we progress together

Published 12 original articles · won praise 17 · views 2986

Guess you like

Origin blog.csdn.net/qq1140037586/article/details/104663174