Updating a row in sql using jdbc
Refer to the JDBC specification for details about JDBC data type to Java object mapping.String sql = "UPDATE employees SET id = id 1000 RETURNING id INTO ?For more information about how to set the classpath, see Using the JDBC Driver.Note The Microsoft JDBC Driver for SQL Server provides and sqljdbc4class library files to be used depending on your preferred Java Runtime Environment (JRE) settings.For more information about which JAR file to choose, see System Requirements for the JDBC Driver.In the following example, the sample code makes a connection to the Adventure Works sample database.
The following example illustrates methods allow you to use GStrings.
For Oracle 8.1.6 and higher, the Oracle driver supports executing Insert, Update, and Delete statements with the Returning clause, which allows your application to return inserted, updated, or deleted values of a row into a variable and eliminate the need to execute additional statements to return this information.
The driver returns the values for each column named in the Returning clause as an output parameter.
Your application must execute the Insert, Update, or Delete statement with the Returning clause using a Callable Statement object.
In addition, your application must specify the data type of each returned value using the Callable Statement.register Out Parameter() method.