JDBC

What are callable statements ?

Callable statements are used from JDBC application to invoke stored procedures and functions.

How to call a stored procedure from JDBC ?

PL/SQL stored procedures are called from within JDBC programs by means of the prepareCall() method of the Connection object created. A call to this method takes variable bind parameters as input parameters as well as output variables and creates an object instance of the CallableStatement class. The following line of code illustrates this:

CallableStatement stproc_stmt = conn.prepareCall(“{call procname(?,?,?)}”); Here conn is an instance of the Connection class.

What is JDBC Driver interface?

The JDBC Driver interface provides vendor-specific implementations of the abstract classes provided by the JDBC API. Each vendor driver must provide implementations of the java.sql.Connection,Statement,PreparedStatement, CallableStatement, ResultSet and Driver.

What is Statement ?

Statement acts like a vehicle through which SQL commands can be sent. Through the connection object we create statement kind of objects. Through the connection object we create statement kind of objects.

Statement stmt = conn.createStatement(); This method returns object which implements statement interface.