Java PreparedStatement complaining about SQL syntax on execute()

前端 未结 6 1847
梦毁少年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 07:05

    Placeholders in JDBC are for data, not for table, column, view or function names. And for good reason. The DB schema of an application is static most of the time and only changes rarely. There are no benefits making them dynamic.

提交回复
热议问题