what are the Different types of exceptions in JDBC?
Exceptions in JDBC are usually of two types:
Exceptions occurring in the JDBC driver
Exceptions occurring in the Oracle 8i database itself
Just as PL/SQL provides for an implicit or explicit RAISE
statement for an exception, Oracle JDBC programs have a
throw statement that is used to inform that JDBC calls
throw the SQL exceptions. This is shown below.
throws SQLException
This creates instances of the class java.sql.SQLException
or a subclass of it.
And, like in PL/SQL, SQL exceptions in JDBC have to be
handled explicitly. Similar to PL/SQL exception handling
sections, Java provides a try..catch section that can
handle all exceptions including SQL exceptions. Handling an
exception can basically include retrieving the error code,
error text, the SQL state, and/or printing the error stack
trace. The SQLException class provides methods for
obtaining all of this information in case of error
conditions.
| Is This Answer Correct ? | 9 Yes | 6 No |
Explain Basic Steps in Writing a Java Program Using Jdbc?
How can we execute stored procedures using callablestatement?
How many ways can you update a result set?
Why prepared statements are faster?
What is JDBC Statement?
What is the purpose of the jdbc resultset interface?
What is the use of the statement in jdbc?
What are different types of ResultSet?
What is JDBC and ODBC and what are the differences between them?
11 Answers Idbi Bank, Infosys, Infoview, TCS,
What is jdbc odbc?
wahts is mean by primary key and unique key?
What are jdbc?