01: package org.gomba.domains;
02:
03: import java.sql.ResultSet;
04:
05: import org.gomba.ParameterDefinition;
06: import org.gomba.ParameterDomain;
07: import org.gomba.ParameterResolver;
08:
09: /**
10: * This domain contains properties extracted from the first row of the ResultSet
11: * for column of type BLOB. Properties have the name of the corresponding
12: * columns. This is useful only for the LOBUpdateServlet.
13: *
14: * @author Flavio Tordini
15: * @version $Id: BLOBColumnDomain.java,v 1.2 2004/07/16 15:42:07 flaviotordini Exp $
16: */
17: public class BLOBColumnDomain implements ParameterDomain {
18:
19: /**
20: * @see org.gomba.ParameterDomain#getParameterValue(org.gomba.ParameterResolver,
21: * org.gomba.ParameterDefinition)
22: */
23: public Object getParameterValue(ParameterResolver context,
24: ParameterDefinition parameter) throws Exception {
25: ResultSet resultSet = context.getResultSet();
26:
27: // The ResultSet cursor should be positioned on a row. If the
28: // resultset is empty we should never even be here. If an Exception
29: // occurs here it is a bug.
30: return resultSet.getBlob(parameter.getName());
31: }
32:
33: /**
34: * @see org.gomba.ParameterDomain#getName()
35: */
36: public String getName() {
37: return "blob";
38: }
39: }
|