Java PreparedStatement complaining about SQL syntax on execute()

前端 未结 6 1863
梦毁少年i
梦毁少年i 2020-12-21 06:20

This is driving me nuts... What am I doing wrong here?

ArrayList toAdd = new ArrayList();
toAdd.add(\"password\");
try{
    Prepa         


        
6条回答
  •  不知归路
    2020-12-21 06:45

    The MySQL manual clearly says that ? (parameter markers) are for binding data values only, not for column names.

    Parameter markers can be used only where data values should appear, not for SQL keywords, identifiers, and so forth.

    So you will have to use your second approach.

提交回复
热议问题