Java SQL: Statement.hasResultSet()?

前端 未结 2 1349
北荒
北荒 2020-12-04 00:44

My app uses MySQL on one platform and SQLite on another, as such there are differences, such as that when using query like DELETE FROM USERS:

  • On <
2条回答
  •  感动是毒
    2020-12-04 01:13

    The problem is that you use invalid method to perform delete operation. Instead of using getResultSet you should use Statement#execute(String)

    IMHO the Exeption in SQLite implementation is more valid than null for MySQL. As delete do not return the set but a scalar value of delted rows.

提交回复
热议问题