Category: Oracle Certification Exam

SQL Injection 2 – Database Connectivity

The PreparedStatement interface provides the following set methods for setting the values of marker parameters: Click here to view code image void setString(int index, String value) Sets a String value for the parameter designated by the index. Click here to view code image void setBoolean(int index, boolean value) Sets a boolean value for the parameter

Callable Statement – Database Connectivity

Callable Statement The Callable interface is a subinterface of the PreparedStatement interface. Callable statements are very similar to prepared statements because both use marker parameters. The main difference is that callable statements are used to invoke named stored procedures and stored functions that reside on the database side. The difference between a function and a

INOUT Parameters – Database Connectivity

INOUT Parameters An INOUT parameter acts as both an IN parameter to pass a value to the stored procedure or function and an OUT parameter to return a value from the stored procedure or function. Before the execution of the callable statement, its value can be initialized with a setXXX() method as for an IN

Processing Query Results – Database Connectivity

24.5 Processing Query Results A result set represents a table of rows that is the result of executing a database query. By default, it is not updatable—that is, it cannot be modified. SELECT queries can be executed by the different types of statements that we have encountered so far to create result sets (p. 1522).

Result Set Navigation Methods – Database Connectivity

Result Set Navigation Methods The following methods of the ResultSet interface can be used to navigate a result set. By default, the cursor can only be moved in the forward direction by calling the next() method. The other navigation methods (previous(), next(), first(), last(), absolute(), and relative(int row)) can only be used if scrolling is

Optimizing the Fetch Size – Database Connectivity

Optimizing the Fetch Size To optimize the processing of rows in the result set that resulted from executing a query, only a certain number of these rows are fetched at a time from the database when they are needed by the result set. The default number to fetch, called the default fetch size, is set

Customizing Result Sets – Database Connectivity

24.6 Customizing Result Sets It is possible to customize certain features of the result set. Such features may not necessarily be available across all databases and in some cases may result in performance degradation. In this section we discuss possible customizations and what can be achieved by them. The following features of the result set

Result Set Concurrency – Database Connectivity

Result Set Concurrency The result set concurrency feature enables or disables whether the result set can be updated or not—that is, it indicates the concurrency mode of the result set. By default, the result set concurrency is set to ResultSet.CONCUR_READ_ONLY, which means the result set cannot be updated. Alternatively, updatability can be enabled by setting

Discovering Database and ResultSet Metadata – Database Connectivity

24.7 Discovering Database and ResultSet Metadata The JDBC API allows Java programs to interact with many different types of databases. Obviously, different database providers have different capabilities and default behaviors, and may or may not support certain SQL features. It is possible to obtain such information using the java.sql.DatabaseMetaData object. This object is obtained from