@ -2982,7 +2982,6 @@ in the primitive wrapper classes explicitly or using auto-boxing.
@@ -2982,7 +2982,6 @@ in the primitive wrapper classes explicitly or using auto-boxing.
@ -4023,7 +4022,7 @@ data from the `t_actor` relation to an instance of the `Actor` class.
@@ -4023,7 +4022,7 @@ data from the `t_actor` relation to an instance of the `Actor` class.
public ActorMappingQuery(DataSource ds) {
super(ds, "select id, first_name, last_name from t_actor where id = ?");
@ -4044,7 +4043,7 @@ for this customer query takes the `DataSource` as the only parameter. In this
@@ -4044,7 +4043,7 @@ for this customer query takes the `DataSource` as the only parameter. In this
constructor you call the constructor on the superclass with the `DataSource` and the SQL
that should be executed to retrieve the rows for this query. This SQL will be used to
create a `PreparedStatement` so it may contain place holders for any parameters to be
passed in during execution.You must declare each parameter using the `declareParameter`
passed in during execution.You must declare each parameter using the `declareParameter`
method passing in an `SqlParameter`. The `SqlParameter` takes a name and the JDBC type
as defined in `java.sql.Types`. After you define all parameters, you call the
`compile()` method so the statement can be prepared and later executed. This class is
@ -4097,9 +4096,7 @@ class since it can easily be parameterized by setting SQL and declaring paramete
@@ -4097,9 +4096,7 @@ class since it can easily be parameterized by setting SQL and declaring paramete
@ -4178,9 +4175,7 @@ output parameter, in this case only one, using the parameter name as the key.
@@ -4178,9 +4175,7 @@ output parameter, in this case only one, using the parameter name as the key.
public class TitlesAndGenresStoredProcedure extends StoredProcedure {
private static final String SPROC_NAME = "AllTitlesAndGenres";
@ -4264,12 +4258,10 @@ the supplied `ResultSet`:
@@ -4264,12 +4258,10 @@ the supplied `ResultSet`:
[source,java,indent=0]
[subs="verbatim,quotes"]
----
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.foo.domain.Title;
import org.springframework.jdbc.core.RowMapper;
public final class TitleMapper implements RowMapper<Title> {
@ -4288,12 +4280,10 @@ the supplied `ResultSet`.
@@ -4288,12 +4280,10 @@ the supplied `ResultSet`.
[source,java,indent=0]
[subs="verbatim,quotes"]
----
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.foo.domain.Genre;
import org.springframework.jdbc.core.RowMapper;
public final class GenreMapper implements RowMapper<Genre> {
@ -4311,17 +4301,15 @@ delegate to the superclass' untyped `execute(Map parameters)` method (which has
@@ -4311,17 +4301,15 @@ delegate to the superclass' untyped `execute(Map parameters)` method (which has
public Object getTypeValue(CallableStatement cs, int colIndx, int sqlType, String typeName) throws SQLException {
STRUCT struct = (STRUCT) cs.getObject(colIndx);
Object[] attr = struct.getAttributes();
TestItem item = new TestItem();
item.setId(((Number) attr[0]).longValue());
item.setDescription((String) attr[1]);
item.setExpirationDate((java.util.Date) attr[2]);
return item;
}
}));
...
}
----
You use the `SqlTypeValue` to pass in the value of a Java object like `TestItem` into a
@ -4538,7 +4531,7 @@ the following example, or ``ArrayDescriptor``s.
@@ -4538,7 +4531,7 @@ the following example, or ``ArrayDescriptor``s.
[source,java,indent=0]
[subs="verbatim,quotes"]
----
final TestItem = new TestItem(123L, "A test item",
final TestItem testItem = new TestItem(123L, "A test item",
new SimpleDateFormat("yyyy-M-d").parse("2010-12-31"));
SqlTypeValue value = new AbstractSqlTypeValue() {
@ -6257,7 +6250,6 @@ constructs a Spring application context, and calls these two methods.
@@ -6257,7 +6250,6 @@ constructs a Spring application context, and calls these two methods.