MySQL Chinese problems and exceptions: org. springframework. Orm. hibernate3.hibernatejdbcexception

Source: Internet
Author: User

All exceptions are displayed as follows:

Org. springframework. Orm. hibernate3.hibernatejdbcexception: JDBC exception on Hibernate data access; Nested exception is org. hibernate. Exception. genericjdbcexception: cocould not execute JDBC batch update

JDBC generation exception occurs after I modify my. ini file of mysql5.0.

Description:

(1) the MySQL database does not support Chinese display;
If the database does not support Chinese characters, an exception occurs. The solution is:
1. Find the MySQL configuration file my. ini.
2. Modify the encoding settings to default-character-set = gb2312.
3. Restart MySQL
4. Drop the original database Latin1
5. Create Database
6. initialize the test unit

(2) the MySQL database supports Chinese display, but Chinese insertion and update operations are not allowed in my project.Org. springframework. Orm. hibernate3.hibernatejdbcexception: JDBC exception on Hibernate data access; Nested exception is org. hibernate. Exception. genericjdbcexception:
Cocould not execute JDBC batch update

Solution:

TomcatCache cleanup and restart the server. OK.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.