Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 2.88 KB

File metadata and controls

35 lines (26 loc) · 2.88 KB
title Using statements with SQL
description Learn an overview of using different types of SQL statements with the Microsoft JDBC Driver for SQL Server.
author David-Engel
ms.author davidengel
ms.date 08/12/2019
ms.service sql
ms.subservice connectivity
ms.topic concept-article

Using statements with SQL

[!INCLUDEDriver_JDBC_Download]

When you work with data in a [!INCLUDEssNoVersion] database by using the [!INCLUDEjdbcNoVersion] and inline SQL statements, there are different classes that you can use. Which class you use depends on the type of SQL statement that you want to run.

If your SQL statement contains no IN parameters, use the SQLServerStatement class, but if it does contain IN parameters, use the SQLServerPreparedStatement class.

Note

If you need to use SQL statements that contain both IN and OUT parameters, you must implement them as stored procedures and call them by using the SQLServerCallableStatement class. For more information about using stored procedures, see Using statements with stored procedures.

The following sections describe the different scenarios for working with data in a [!INCLUDEssNoVersion] database by using SQL statements.

In This Section

Topic Description
Using a SQL statement with no parameters Describes how to use SQL statements that contain no parameters.
Using a SQL statement with parameters Describes how to use SQL statements that contain parameters.
Using a SQL statement to modify database objects Describes how to use SQL statements to modify database objects.
Using a SQL statement to modify data Describes how to use SQL statements to modify data in a database.

See also

Using Statements with the JDBC driver