使用Mybatis时由于粗心遇到Cause: : sql injection violation异常

时间:2024-11-15 15:46:21
  • :
  • ### Error updating database. Cause: : sql injection violation, syntax error: syntax error. pos 237, line 9, column 26, token IDENTIFIER phone : insert into mmall_product
  • (
  • id, category_id, name, subtitle, main_image, sub_images,
  • detail, price, stock, status, create_time, update_time
  • )
  • values (
  • ?, ?, ?, hello phone,
  • ?, ?, ?, ?,
  • ?, ?,
  • now(),
  • now()
  • )
  • ### SQL: insert into mmall_product ( id, category_id, name, subtitle, main_image, sub_images, detail, price, stock, status, create_time, update_time ) values ( ?, ?, ?, hello phone, ?, ?, ?, ?, ?, ?, now(), now() )
  • ### Cause: : sql injection violation, syntax error: syntax error. pos 237, line 9, column 26, token IDENTIFIER phone : insert into mmall_product
  • (
  • id, category_id, name, subtitle, main_image, sub_images,
  • detail, price, stock, status, create_time, update_time
  • )
  • values (
  • ?, ?, ?, hello phone,
  • ?, ?, ?, ?,
  • ?, ?,
  • now(),
  • now()
  • )
  • ; uncategorized SQLException; SQL state [null]; error code [0]; sql injection violation, syntax error: syntax error. pos 237, line 9, column 26, token IDENTIFIER phone : insert into mmall_product
  • (
  • id, category_id, name, subtitle, main_image, sub_images,
  • detail, price, stock, status, create_time, update_time
  • )
  • values (
  • ?, ?, ?, hello phone,
  • ?, ?, ?, ?,
  • ?, ?,
  • now(),
  • now()
  • ); nested exception is : sql injection violation, syntax error: syntax error. pos 237, line 9, column 26, token IDENTIFIER phone : insert into mmall_product
  • (
  • id, category_id, name, subtitle, main_image, sub_images,
  • detail, price, stock, status, create_time, update_time
  • )
  • values (
  • ?, ?, ?, hello phone,
  • ?, ?, ?, ?,
  • ?, ?,
  • now(),
  • now()
  • )
  • at (:89)
  • at (:81)
  • at (:81)
  • at (:73)
  • at $(:446)
  • at .$(Unknown Source)
  • at (:278)
  • at (:58)
  • at (:59)
  • at .$(Unknown Source)
  • at (:26)
  • at .invoke0(Native Method)
  • at (:62)
  • at (:43)
  • at (:498)
  • at $1.runReflectiveCall(:50)
  • at (:12)
  • at (:47)
  • at (:17)
  • at .(:74)
  • at .(:84)
  • at .(:75)
  • at .(:86)
  • at .(:84)
  • at (:325)
  • at .junit4.(:251)
  • at .junit4.(:97)
  • at $3.run(:290)
  • at $1.schedule(:71)
  • at (:288)
  • at $000(:58)
  • at $2.evaluate(:268)
  • at .(:61)
  • at .(:70)
  • at (:363)
  • at .junit4.(:190)
  • at (:137)
  • at .junit4.(:68)
  • at $(:47)
  • at (:242)
  • at (:70)
  • Caused by: : sql injection violation, syntax error: syntax error. pos 237, line 9, column 26, token IDENTIFIER phone : insert into mmall_product
  • (
  • id, category_id, name, subtitle, main_image, sub_images,
  • detail, price, stock, status, create_time, update_time
  • )
  • values (
  • ?, ?, ?, hello phone,
  • ?, ?, ?, ?,
  • ?, ?,
  • now(),
  • now()
  • )
  • at (:798)
  • at .connection_prepareStatement(:251)
  • at .connection_prepareStatement(:568)
  • at .connection_prepareStatement(:929)
  • at .connection_prepareStatement(:122)
  • at .connection_prepareStatement(:568)
  • at (:342)
  • at (:349)
  • at (:87)
  • at (:88)
  • at (:59)
  • at (:85)
  • at (:49)
  • at (:117)
  • at (:76)
  • at .invoke0(Native Method)
  • at (:62)
  • at (:43)
  • at (:498)
  • at (:63)
  • at .$(Unknown Source)
  • at (:198)
  • at (:185)
  • at .invoke0(Native Method)
  • at (:62)
  • at (:43)
  • at (:498)
  • at $(:433)
  • ... 36 more
  • Caused by: : syntax error. pos 237, line 9, column 26, token IDENTIFIER phone
  • at (:3323)
  • at (:2553)
  • at (:47)
  • at (:167)
  • at (:83)
  • at (:624)
  • at (:578)
  • at (:785)
  • ... 63 more