Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxError Exception

Source: Internet
Author: User

1. Error description

Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxError Exception:you has an error on your SQL syntax check the manual that Corr Esponds to your MySQL server version for the right syntax to use near ' notnull,user_name varchar (255)) ' on line 1


2. Cause of Error

StringBuilder sql = new StringBuilder (); Sql.append ("CREATE Table T_you_su_ta ("); Sql.append ("ID int primary key,"); Sql.append ("user_id int notnull,") sql.append ("user_name varchar (255))");

When you create a database table in the stitching, you want to make the user_id not empty, defined as "Notnull"


3. Solutions

When stitching user_id, it should be changed to "user_id int not NULL"

Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxError Exception

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.