executeUpdate() returns zero despite correct execution

前端 未结 3 1153
北恋
北恋 2021-01-25 18:10

create_PaperBean.java

package Beans;

import java.sql.SQLException;
import java.sql.Statement;
import java.util.loggin         


        
3条回答
  •  被撕碎了的回忆
    2021-01-25 18:49

    I am bit doubted about your query as well, you might need to look at this

       CREATE TABLE `test1` ( contact_id INT(10),name VARCHAR(40),
       birthdate DATE,PRIMARY KEY    (contact_id));
    

    If the update happens correctly then the value is 1, if not its 0. Moreover, it return 0 when your statement does not affect any row , for example in DDL execution it may return 0.

提交回复
热议问题