mysqlデータベースにデータを挿入しようとしていますが、エラーが発生し、コードでエラーを見つけることができません。私はmysqlが得意ではありません。
String insertQuery = "insert into books(title, author, description, prize)values("
+ title
+ ","
+ author
+ ","
+ desc
+ ", "
+ prize
+ ");";
mysql> describe books;
+-------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+-------+
| book_id | int(11) | NO | PRI | NULL | |
| title | varchar(64) | YES | | NULL | |
| author | varchar(64) | YES | | NULL | |
| description | varchar(500) | YES | | NULL | |
| prize | float | YES | | NULL | |
| added | datetime | YES | | NULL | |
+-------------+--------------+------+-----+---------+-------+
6 rows in set (0.01 sec)
私が得るエラーは、
Query: insert into books(title, author, description, prize)values(sfdfdf,fdfdf,Please limiasasaat your response to 500 characters., 78.9);
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limiasasaat your response to 500 characters., 78.9)' at line 1