public interface AggregateFunction
Please note this interface only has limited support for data types.
If you need data types that don't have a corresponding SQL type
(for example GEOMETRY), then use the Aggregate
interface.
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object value)
This method is called once for each row.
|
java.lang.Object |
getResult()
This method returns the computed aggregate value.
|
int |
getType(int[] inputTypes)
This method must return the SQL type of the method, given the SQL type of
the input data.
|
default void |
init(java.sql.Connection conn)
This method is called when the aggregate function is used.
|
default void init(java.sql.Connection conn) throws java.sql.SQLException
conn
- a connection to the databasejava.sql.SQLException
- on SQL exceptionint getType(int[] inputTypes) throws java.sql.SQLException
inputTypes
- the SQL type of the parameters, Types
java.sql.SQLException
- on failurevoid add(java.lang.Object value) throws java.sql.SQLException
value
- the value(s) for this rowjava.sql.SQLException
- on failurejava.lang.Object getResult() throws java.sql.SQLException
java.sql.SQLException
- on failure