Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.45 KB

File metadata and controls

48 lines (36 loc) · 1.45 KB
title prepareStatement Method (java.lang.String, int)
description prepareStatement Method (java.lang.String, int)
author David-Engel
ms.author davidengel
ms.date 01/22/2026
ai-usage ai-assisted
ms.service sql
ms.subservice connectivity
ms.topic reference
apilocation sqljdbc.jar
apiname SQLServerConnection.prepareStatement (java.lang.String, int)
apitype Assembly

prepareStatement Method (java.lang.String, int)

Creates a SQLServerPreparedStatement object that has the capability to retrieve autogenerated keys.

Syntax

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int autoGeneratedKeys)

Parameters

sql

A String containing a SQL statement.

autoGeneratedKeys

An int flag indicating whether autogenerated keys should be returned. One of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS.

Return Value

A PreparedStatement object.

Exceptions

SQLServerException

Remarks

This prepareStatement method is specified by the prepareStatement method in the java.sql.Connection interface.

Related content