JavaXT

Function Class

Used to encapsulate SQL functions for database inserts and updates. This class is used in conjunction with the Recordset class. Example:
rs.setValue("LAST_UPDATE", new javaxt.sql.Function("NOW()"));
Functions can be parameterized for more efficient inserts and updates. This is especially important for batch inserts. For example, instead of this:
rs.setValue("DATEDIFF_TEST", new javaxt.sql.Function("DATEDIFF(year, '2012/04/28', '2014/04/28')"));
The function can be parameterized like this:
rs.setValue("DATEDIFF_TEST", new javaxt.sql.Function("DATEDIFF(year, ?, ?)", new Object[]{"2012/04/28", "2014/04/28"}));

Constructors

public Function( String function, Object[] values )
public Function( String function )

Methods

getFunction( ) returns String
getValues( ) returns Object[]
hasValues( ) returns boolean
toString( ) returns String