|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface allows InstantDB to add new SQL functions dynamically.
Classes which implement this interface can be used to evaluate functions as part of InstantDB SQL expressions. Whenever InstantDB encounters a function, other than an aggregate function, it uses the function name to create an instance of a class of that name. The function name is converted to lowercase. So TO_DATE(...) would create an instance of a class named to_date().
Classes which implement this interface can be placed anywhere on the classpath, or they can be Java 2 extension classes. They can even be added while the database is still running.
Field Summary | |
static int |
DATE_FORMAT
Get special constant DATE_FORMAT. |
static int |
MILLENIUM_BOUNDARY
Set special constant MILLENIUM_BOUNDARY. |
static int |
TYPE_BLOB
Parameter type TYPE_BLOB |
static int |
TYPE_BYTE
Parameter type TYPE_BYTE |
static int |
TYPE_CURRENCY
Parameter type TYPE_CURRENCY |
static int |
TYPE_DATE
Parameter type TYPE_DATE |
static int |
TYPE_DOUBLE
Parameter type TYPE_DOUBLE |
static int |
TYPE_FLOAT
Parameter type TYPE_FLOAT |
static int |
TYPE_INTEGER
Parameter type TYPE_INTEGER |
static int |
TYPE_LONG
Parameter type TYPE_LONG |
static int |
TYPE_STRING
Parameter type TYPE_STRING |
Method Summary | |
int |
checkParameters(int[] parameterTypes)
Allows a function object to check the types of the parameters which will be passed to it when it is asked to evaluate itself. |
java.lang.Object |
evaluate(java.lang.Object[] parameters)
Evaluates an function. |
java.lang.Object |
getSpecialValue(int type)
Used by InstantDB to fetch database information from a function. |
void |
setSpecialValue(int type,
java.lang.Object value)
Used by InstantDB to pass database information into a function. |
Field Detail |
public static final int TYPE_BYTE
public static final int TYPE_INTEGER
public static final int TYPE_STRING
public static final int TYPE_LONG
public static final int TYPE_DATE
public static final int TYPE_CURRENCY
public static final int TYPE_FLOAT
public static final int TYPE_DOUBLE
public static final int TYPE_BLOB
public static final int MILLENIUM_BOUNDARY
public static final int DATE_FORMAT
Method Detail |
public int checkParameters(int[] parameterTypes) throws java.sql.SQLException
The function must return the type corresponding to its expected evaluation type.
The method should throw a SQLException containing an appropriate error message if the parameters are deemed to be incorrect.
public java.lang.Object evaluate(java.lang.Object[] parameters) throws java.sql.SQLException
The function must return the an object of the type determined by the result of checkParameters method.
The method should throw a SQLException containing an appropriate error message if the evaluation cannot complete.
public void setSpecialValue(int type, java.lang.Object value) throws java.sql.SQLException
public java.lang.Object getSpecialValue(int type) throws java.sql.SQLException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |