the following example is not a complete application, only a method - the samples in the remainder of this document do not include the code required to set up and tear down a Connection
. To experiment with the example, you must provide a class that invokes the sample code.
method expects a single argument from the caller, a Connection
object that must be connected to an Advanced Server database.:
method returns the number of rows affected by the SQL statement (an INSERT
typically affects one row, but an UPDATE
statement can affect more). If executeUpdate()
returns without throwing an error, the call to System.out.println
displays a message to the user that shows the number of rows affected.