int goods_id unique,
int goods_infos auto_increment
Cannot add or update a child row: a foreign key constraint fails (peopleinfosforsb
.vacancy_timers
, CONSTRAINT vacancy_timers_ibfk_1
FOREIGN KEY (task_name
) REFERENCES vacancy_tasks
(task_name
) ON DELETE CASCADE ON UPDATE CASCADE
Cannot add or update a child row: a foreign key constraint fails (peopleinfosforsb
.vacancy_timers
, CONSTRAINT vacancy_timers_ibfk_1
FOREIGN KEY (task_name
) REFERENCES vacancy_tasks
(task_name
) ON DELETE CASCADE ON UPDATE CASCADE
Error updating database. Cause: 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 'group, name)
nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘task_name’ in ‘class java.lang.String’
-原因
未设置字符键值对.
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1045, “Access denied for user ‘root’@‘localhost’ (using password: YES)”)
invalid comparison: java.util.ArrayList and java.lang.String
场景:传入数据为list(Array),参数比较时,使用了字符比较
参数:List nameLis=Array.asList(“xiaoxiao”,“xiaohua”);
Mybatis比较形式:
<if test="nameLis != null and nameLis !=''">
and name in
<foreach collection="nameLis" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
nameLis为List类型,而nameLis != ''是字符串比较,因此报错,
正确形式为:
<if test="nameLis != null and nameLis.size()>0">
and name in
<foreach collection="nameLis" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
【参考文献】
[1]https://www.cnblogs.com/liushui-sky/p/8830936.html
[2]https://blog.csdn.net/qq_41042595/article/details/88591028
[3]https://blog.csdn.net/hmmmmm2929/article/details/93193394
[4]https://www.jianshu.com/p/9152bcbd0e91
[5]https://www.cnblogs.com/orac/p/6726323.html
[6]
[7]https://blog.csdn.net/qq_43642812/article/details/89578126
[8]https://www.cnblogs.com/zyulike/p/10542341.html
本文地址:https://blog.csdn.net/Xin_101/article/details/103062758
如对本文有疑问, 点击进行留言回复!!
Postgresql结合postgis使用java的JDBC连接
网友评论