Interface JdbcClient


public interface JdbcClient
A fluent JdbcClient with common JDBC query and update operations, supporting JDBC-style positional as well as Spring-style named parameters with a convenient unified facade for JDBC PreparedStatement execution.

An example for retrieving a query result as a java.util.Optional:

Optional<Integer> value = client.sql("SELECT AGE FROM CUSTOMER WHERE ID = :id")
    .param("id", 3)
    .query(Integer.class)
    .optional();

Delegates to JdbcTemplate and NamedParameterJdbcTemplate. For complex JDBC operations — for example, batch inserts and stored procedure calls — you may use those lower-level template classes directly, or alternatively SimpleJdbcInsert and SimpleJdbcCall.

Since:
6.1
Author:
Juergen Hoeller, Sam Brannen
See Also: