SQLException เกิดได้ทั้งใน driver และ database เมื่อเกิด exception จะส่ง object SQLException ไปที่ catch clause มีเมธอดดังนี้:
| เมธอด | คำอธิบาย |
|---|---|
| getErrorCode() | ดึงรหัสข้อผิดพลาดที่เกี่ยวข้อง |
| getMessage() | ดึงข้อความ error จาก JDBC driver หรือ Oracle error number/message |
| getSQLState() | ดึง XOPEN SQLstate string 5 หลัก สำหรับ database error สำหรับ driver error คืนค่าที่ไม่มีประโยชน์ อาจคืน null |
| getNextException() | ดึง Exception ถัดไปใน exception chain |
| printStackTrace() | พิมพ์ exception ปัจจุบันและ backtrace ไป standard error stream |
| printStackTrace(PrintStream s) | พิมพ์ throwable และ backtrace ไป print stream ที่ระบุ |
| printStackTrace(PrintWriter w) | พิมพ์ throwable และ backtrace ไป print writer ที่ระบุ |