20230628 java.sql.SQLException

发布时间 2023-08-28 09:53:43作者: 流星<。)#)))≦

介绍

  • java.sql.SQLException
  • public class SQLException extends java.lang.Exception implements Iterable
  • 每个 SQLException 都有一个由多个 SQLException 对象构成的链
  • 有大量的异常子类,按照树结构组织

API

构造器

  • SQLException()
  • SQLException(String reason)
  • SQLException(Throwable cause)
  • SQLException(String reason, Throwable cause)
  • SQLException(String reason, String SQLState)
  • SQLException(String reason, String SQLState, int vendorCode)
  • SQLException(String reason, String sqlState, Throwable cause)
  • SQLException(String reason, String sqlState, int vendorCode, Throwable cause)
    • sqlState : 标准化的错误代码
    • vendorCode : 特定数据库供应商的错误代码

public

  • iterator
  • getErrorCode
    • 对应构造器入参中的 vendorCode
  • getSQLState
    • 对应构造器入参中的 sqlState
  • setNextException, getNextException