Class SimpleJdbcInsert

java.lang.Object
org.springframework.jdbc.core.simple.AbstractJdbcInsert
org.springframework.jdbc.core.simple.SimpleJdbcInsert
All Implemented Interfaces:
SimpleJdbcInsertOperations

public class SimpleJdbcInsert extends AbstractJdbcInsert implements SimpleJdbcInsertOperations
A SimpleJdbcInsert is a multi-threaded, reusable object providing easy (batch) insert capabilities for a table. It provides meta-data processing to simplify the code needed to construct a basic insert statement. All you need to provide is the name of the table and a Map containing the column names and the column values.

The meta-data processing is based on the DatabaseMetaData provided by the JDBC driver. As long as the JDBC driver can provide the names of the columns for a specified table then we can rely on this auto-detection feature. If that is not the case, then the column names must be specified explicitly.

The actual (batch) insert is handled using Spring's JdbcTemplate.

Many of the configuration methods return the current instance of the SimpleJdbcInsert to provide the ability to chain multiple ones together in a "fluent" API style.

Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller, Sam Brannen
See Also: