SQL Server allows only a single IDENTITY column per table. The result set that is returned by getGeneratedKeys method of the SQLServerStatement class will have only one column, with the returned column name of GENERATEDKEYS. If generated keys are requested on a table that has no IDENTITY column, the JDBC driver will return a null result set.
-->Runs the given SQL statement and signals Microsoft JDBC Driver for SQL Server that the auto-generated keys indicated in the given array should be made available for retrieval.
The only way that some JDBC drivers to return Statement.RETURNGENERATEDKEYS is to do something of the following: long key = -1L; Statement statement = connection.createStatement; statement. Stack Overflow. Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. This array contains the names of the columns in the target table that contain the auto-generated keys.
Syntax
Parameters
![Execute Execute](/uploads/1/2/6/0/126048720/578806137.png)
sql
A String that contains an SQL statement.
columnNames
An array of type String that indicates which column names of the auto-generated keys should be made available.
Return Value
An int that indicates the number of rows affected, 0 if using a DDL statement.
Exceptions
Remarks
This executeUpdate method is specified by the executeUpdate method in the java.sql.Statement interface.
If executing a stored procedure results in an update count that is greater than one, or that generates more than one result set, use the execute method to execute the stored procedure.
Execute Update Now
See Also
executeUpdate Method (SQLServerStatement)
SQLServerStatement Members
SQLServerStatement Class
SQLServerStatement Members
SQLServerStatement Class
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
![Execute update now Execute update now](/uploads/1/2/6/0/126048720/826794688.png)
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
commented Jan 18, 2019 •
TX-LCN 5.0 使用 mybatis 和 mysql-connector-java 8.0.12 高版本导致无法分布式插入 |
commented Jan 18, 2019 •
解决办法:
|
Executeupdate Return Generated Keys
closed this Feb 7, 2019
Execute Update Return Generated Keys Download
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment