Bind variables are variable substitutes for literals in a SQL statement. They are used in conjunction with OraclePreparedStatement
and OracleCallableStatement
to specify parameter values that are used to build the SQL statement. Using bind variables has remarkable performance advantages in a production environment.
For PL/SQL blocks or stored procedure calls, you can use the following qualifiers to differentiate between input and output variables: IN
, OUT
, and IN OUT
. Input variable values are set by using set
XXX
methods and OUT
variable values can be retrieved by using get
XXX
methods, where XXX
is the Java data type of the values. This depends on the SQL data types of the columns that you are accessing in the database.