what are the Different types of exceptions in JDBC?



what are the Different types of exceptions in JDBC?..

Answer / venu gopal.c t.c.s

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

Post New Answer

More JDBC Interview Questions

Can we make a database connection from HTML ?

6 Answers   Aptech, BOB Technologies, Cap Gemini, Wipro,


What is the difference between triggers and procedures?

1 Answers  


When do we get java.sql.SQLException: No suitable driver found?

0 Answers  


What is jdbc? Describe the steps needed to execute a sql query using jdbc.

0 Answers  


Name the types of jdbc drivers.

0 Answers  


What is the function of setautocommit?

0 Answers  


Can the JDBC-ODBC Bridge be used with applets?

2 Answers  


what are the Different types of exceptions in JDBC?

1 Answers  


Does the database server have to be running Java or have Java support in order for my remote JDBC client app to access the database?

0 Answers  


What are the exceptions in jdbc?

0 Answers  


code to insert values/rows into oracle database from a java swing textfield when a button is pressed(using preparedstatements)

0 Answers  


Is jdbc part of j2ee?

0 Answers  


Categories