- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the important methods of the SQLException class?
An SQLException can occur both in the driver and the database. When such an exception occurs, an object of type SQLException will be passed to the catch clause.
The passed SQLException object has the following methods available for retrieving additional information about the exception:
Method | Description |
---|---|
getErrorCode( ) | Gets the error number associated with the exception. |
getMessage( ) | Gets the JDBC driver's error message for an error, handled by the driver or gets the Oracle error number and message for a database error. |
getSQLState( ) | Gets the XOPEN SQLstate string. For a JDBC driver error, no useful information is returned from this method. For a database error, the five-digit XOPEN SQLstate code is returned. This method can return null. |
getNextException( ) | Gets the next Exception object in the exception chain. |
printStackTrace( ) | Prints the current exception, or throwable, and it's backtrace to a standard error stream. |
printStackTrace(PrintStream s) | Prints this throwable and its backtrace to the print stream you specify. |
printStackTrace(PrintWriter w) | Prints this throwable and it's backtrace to the print writer you specify. |
- Related Articles
- What are the Important Array Methods in JavaScript?
- What are the methods and properties of the Thread class in C#?
- What are the differences between class methods and class members in C#?
- What are some of the commonly used methods of the array class in C#?
- Methods of the Thread Class
- What are the various methods available under Select class in Selenium?
- What are the important components of ODBC?
- What are the important components of JDBC?
- What are static methods in a Python class?
- What are Getters/Setters methods for Python Class?
- What are Class/Static methods in Java?\n
- What are new methods added to the String class in Java 9?
- What are the methods of clustering?
- What are the methods of separation
- What are the important characteristics of Living Beings?

Advertisements