mybatis向mysql插入含有逗號的值報錯,mybatismysql

來源:互聯網
上載者:User

mybatis向mysql插入含有逗號的值報錯,mybatismysql
   mybatis向mysql插入形如“11,22,33”的時候報錯。錯誤的原因是我用貨幣符號拼接的sql。正確做法是用#  有時間看看mybatis的$和#的區別。

mysql 用mybatis添加 報錯 指點

--> 檢查 --> jdbc 是否匯入 classpath?
--> 另外, 可能是你的sql statement 寫錯了
------> 檢查這裡
insert into picture p (p.picturename,p.filepath) values( #{picturename} , #{filepath} )
------> INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...)
-----------> 這裡 picture 後面 p 是什麼?

-----> 其他問題, 暫不明.
 
MyBatis插入問題,被插入的對象裡麵包含有子物件,該怎書寫MyBatis的SQL?非常急,可追加大量分數

<insert id="create" parameterType="Teacher">
INSERT INTO xstb_teacher ( name,
studentName )
VALUES(
#{name,jdbcType=NVARCHAR},

#{student.name,jdbcType=NVARCHAR}
)
</insert>
 

相關文章

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.