Java MessageFormat - How can I insert values between single quotes?

前端 未结 5 1824
渐次进展
渐次进展 2020-12-05 09:03

I\'m having a problem using the java.text.MessageFormat object.

I\'m trying to create SQL insert statements. The problem is, when I do something like this:

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 09:52

    Use triple single quote characters:

    MessageFormat messageFormat = "insert into {0} values ( '''{1}''', '''{2}''', '''{3}''', '''{4}''' )";
    

提交回复
热议问题