SimpleJdbcInsert.
This interface is not often used directly, but provides the option to enhance testability, as it can easily be mocked or stubbed.
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int | Returns: the number of rows affected as returned by the JDBC driverthe SqlParameterSource containing values to use for insert parameterSource)Execute the insert using the values passed in. |
| public Number | Returns: the generated key valuea Map containing column names and corresponding value args)Execute the insert using the values passed in and return the generated key. |
| public Number | Returns: the generated key value.the SqlParameterSource containing values to use for insert parameterSource)Execute the insert using the values passed in and return the generated key. |
| public KeyHolder | Returns: the KeyHolder containing all generated keysa Map containing column names and corresponding value args)Execute the insert using the values passed in and return the generated keys. |
| public KeyHolder | Returns: the KeyHolder containing all generated keysthe SqlParameterSource containing values to use for insert parameterSource)Execute the insert using the values passed in and return the generated keys. |
| public int[] | Returns: the array of number of rows affected as returned by the JDBC driveran array of Maps containing a batch of column names and corresponding value batch)Execute a batch insert using the batch of values passed in. |
| public int[] | Returns: the array of number of rows affected as returned by the JDBC driveran array of SqlParameterSource containing values for the batch batch)Execute a batch insert using the batch of values passed in. |
| public SimpleJdbcInsertOperations | Returns: thisSimpleJdbcInsert (for method chaining)Include synonyms for the column meta-data lookups via JDBC. |
| public SimpleJdbcInsertOperations | Returns: thisSimpleJdbcInsert (for method chaining)one or more column names columnNames)Specify the column names that the insert statement should be limited to use. |
| public SimpleJdbcInsertOperations | Returns: thisSimpleJdbcInsert (for method chaining)one or more column names columnNames)Specify the names of any columns that have auto-generated keys. |
| public SimpleJdbcInsertOperations | Returns: thisSimpleJdbcInsert (for method chaining)Specify that SQL identifiers should be quoted. |
| public SimpleJdbcInsertOperations | Returns: thisSimpleJdbcInsert (for method chaining)the name of the catalog catalogName)Specify the catalog name, if any, to be used for the insert. |
| public SimpleJdbcInsertOperations | Returns: thisSimpleJdbcInsert (for method chaining)Turn off any processing of column meta-data information obtained via JDBC. |
| public SimpleJdbcInsertOperations | Returns: thisSimpleJdbcInsert (for method chaining)the name of the schema schemaName)Specify the schema name, if any, to be used for the insert. |
| public SimpleJdbcInsertOperations | Returns: thisSimpleJdbcInsert (for method chaining)the name of the stored table tableName)Specify the table name to be used for the insert. |
| execute | back to summary |
|---|---|
| public int execute(Map<String, ?> args) Execute the insert using the values passed in. | |
| execute | back to summary |
|---|---|
| public int execute(SqlParameterSource parameterSource) Execute the insert using the values passed in.
| |
| executeAndReturnKey | back to summary |
|---|---|
| public Number executeAndReturnKey(Map<String, ?> args) Execute the insert using the values passed in and return the generated key. This requires that the name of the columns with auto generated keys have been specified. This method will always return a KeyHolder but the caller must verify that it actually contains the generated keys. | |
| executeAndReturnKey | back to summary |
|---|---|
| public Number executeAndReturnKey(SqlParameterSource parameterSource) Execute the insert using the values passed in and return the generated key. This requires that the name of the columns with auto generated keys have been specified. This method will always return a KeyHolder but the caller must verify that it actually contains the generated keys.
| |
| executeAndReturnKeyHolder | back to summary |
|---|---|
| public KeyHolder executeAndReturnKeyHolder(Map<String, ?> args) Execute the insert using the values passed in and return the generated keys. This requires that the name of the columns with auto generated keys have been specified. This method will always return a KeyHolder but the caller must verify that it actually contains the generated keys. | |
| executeAndReturnKeyHolder | back to summary |
|---|---|
| public KeyHolder executeAndReturnKeyHolder(SqlParameterSource parameterSource) Execute the insert using the values passed in and return the generated keys. This requires that the name of the columns with auto generated keys have been specified. This method will always return a KeyHolder but the caller must verify that it actually contains the generated keys.
| |
| executeBatch | back to summary |
|---|---|
| public int[] executeBatch(Map<String, ?>... batch) Execute a batch insert using the batch of values passed in.
| |
| executeBatch | back to summary |
|---|---|
| public int[] executeBatch(SqlParameterSource... batch) Execute a batch insert using the batch of values passed in.
| |
| includeSynonymsForTableColumnMetaData | back to summary |
|---|---|
| public SimpleJdbcInsertOperations includeSynonymsForTableColumnMetaData() Include synonyms for the column meta-data lookups via JDBC. Note This is only necessary to include for Oracle since other databases supporting synonyms seem to include the synonyms automatically.
| |
| usingColumns | back to summary |
|---|---|
| public SimpleJdbcInsertOperations usingColumns(String... columnNames) Specify the column names that the insert statement should be limited to use.
| |
| usingGeneratedKeyColumns | back to summary |
|---|---|
| public SimpleJdbcInsertOperations usingGeneratedKeyColumns(String... columnNames) Specify the names of any columns that have auto-generated keys.
| |
| usingQuotedIdentifiers | back to summary |
|---|---|
| public SimpleJdbcInsertOperations usingQuotedIdentifiers() Specify that SQL identifiers should be quoted. If this method is invoked, the identifier quote string for the underlying database will be used to quote SQL identifiers in generated SQL statements. In this context, SQL identifiers refer to schema, table, and column names. When identifiers are quoted, explicit column names must be supplied via
| |
| withCatalogName | back to summary |
|---|---|
| public SimpleJdbcInsertOperations withCatalogName(String catalogName) Specify the catalog name, if any, to be used for the insert.
| |
| withoutTableColumnMetaDataAccess | back to summary |
|---|---|
| public SimpleJdbcInsertOperations withoutTableColumnMetaDataAccess() Turn off any processing of column meta-data information obtained via JDBC.
| |
| withSchemaName | back to summary |
|---|---|
| public SimpleJdbcInsertOperations withSchemaName(String schemaName) Specify the schema name, if any, to be used for the insert.
| |
| withTableName | back to summary |
|---|---|
| public SimpleJdbcInsertOperations withTableName(String tableName) Specify the table name to be used for the insert.
| |