Function Class

The Function class is used to encapsulate SQL functions when inserting or updating records via the javaxt.sql.Recordset class. Example:
    rs.setValue("LAST_UPDATE", new javaxt.sql.Function("NOW()"));
    rs.setValue("DATEDIFF_TEST", new javaxt.sql.Function("DATEDIFF(year, '2012/04/28', '2014/04/28')"));  
Note that functions can be parameterized using standard JDBC syntax using question marks (? characters) like this:
    JSONObject json = new JSONObject();
    rs.setValue("info", new javaxt.sql.Function("?::jsonb", json.toString()));  
Parameterizing values is especially useful when dealing with strings and other values that may have invalid characters. It is also extremely useful when performing batch inserts.

Constructors

Function( String function )
Function( String function, Object... values )

Public Methods

getFunction( ) returns String
Returns the function supplied in the constructor
hasValues( ) returns boolean
Returns true if values were supplied to the constructor
getValues( ) returns Object[]
Returns an array of values that were supplied in the constructor
toString( ) returns String
Returns the function supplied in the constructor