JavaXT
|
|
Function ClassThe 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. ConstructorsPublic MethodsgetValues( ) returns Object[] Returns an array of values that were supplied in the constructor |