org.millscript.millscript.functions
Class JdbcExecuteQueryFunction
java.lang.Object
org.millscript.millscript.functions.Function
org.millscript.millscript.functions.JdbcExecuteQueryFunction
public class JdbcExecuteQueryFunction
- extends Function
This class implements a millscript function to execute an SQL query through
the JDBC interface. The query is done using a prepared statement, which
should improve efficiency for multiple queries. The generated function
requires at least one argument, which will be the DataSource for the query.
Any subsequent arguments are treated as parameters for the prepared
statement.
f( datasource, arg1, arg2, arg3, ... )
The function returns a list-of-maps.
- Since:
- 9.6.4
|
Constructor Summary |
JdbcExecuteQueryFunction(java.lang.String s)
Construct a new function which will execute the specifed SQL as a
prepared statement. |
|
Method Summary |
void |
apply(Machine mc,
int nargs)
Performs this function using the specified machine, with the specified
number of arguments. |
java.lang.String |
toString()
Returns a string representation of this function. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
JdbcExecuteQueryFunction
public JdbcExecuteQueryFunction(java.lang.String s)
- Construct a new function which will execute the specifed SQL as a
prepared statement.
- Parameters:
s - the string containing SQL to prepare and execute
apply
public void apply(Machine mc,
int nargs)
- Description copied from class:
Function
- Performs this function using the specified machine, with the specified
number of arguments.
- Specified by:
apply in class Function
- Parameters:
mc - the machine to perform this function onnargs - the number of arguments the function is being invoked with- See Also:
Function.apply(org.millscript.millscript.vm.Machine, int)
toString
public java.lang.String toString()
- Returns a string representation of this function. It shows that it
requires one or more arguments.
- Overrides:
toString in class Function
- Returns:
- a string representation of this function
- See Also:
Object.toString()
Copyright © 2001-2007 Open World Ltd. All Rights Reserved.