Using Statements with SQL

Using Statements with SQL

 

DownloadDownload JDBC Driver

When you work with data in a SQL Server database by using the Microsoft JDBC Driver for SQL Server 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.

System_CAPS_ICON_note.jpg 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 SQL Server database by using SQL statements.

TopicDescription
Using an SQL Statement with No ParametersDescribes how to use SQL statements that contain no parameters.
Using an SQL Statement with ParametersDescribes how to use SQL statements that contain parameters.
Using an SQL Statement to Modify Database ObjectsDescribes how to use SQL statements to modify database objects.
Using an SQL Statement to Modify DataDescribes how to use SQL statements to modify data in a database.

Using Statements with the JDBC Driver

Community Additions

ADD
Show:
© 2016 Microsoft