Using Statements with the JDBC Driver
The Microsoft SQL Server JDBC Driver can be used to work with data in a SQL Server database in a variety of ways. The JDBC driver can be used to run SQL statements against the database, or it can be used to call stored procedures in the database, using both input and output parameters. The JDBC driver also supports using SQL escape sequences, update counts, automatically generated keys, and performing updates within a batch operation.
The JDBC driver provides three classes for retrieving data from a SQL Server database:
SQLServerStatement - used for running SQL statements without parameters.
SQLServerPreparedStatement - (inherited from SQLServerStatement), used for running compiled SQL statements that might contain IN parameters.
SQLServerCallableStatement - (inherited from SQLServerPreparedStatement), used for running stored procedures that might contain IN parameters, OUT parameters, or both.
The topics in this section discuss how you can use each of the three statement classes to work with data in a SQL Server database.
Describes how to use SQL statements with the JDBC driver to work with data in a SQL Server database.
Describes how to use stored procedures with the JDBC driver to work with data in a SQL Server database.
Describes how to use the JDBC driver to retrieve data from multiple result sets.
Describes how to use SQL escape sequences, such as date and time literals and functions.
Describes how to use automatically generated keys.
Describes how to use the JDBC driver to perform batch operations.
Describes how to use the JDBC driver to run complex statements that perform a variety of tasks and might return different types of data.