|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.javascript.ScriptableObject
org.apache.cocoon.components.flow.javascript.ScriptableConnection
public class ScriptableConnection
Wraps a JDBC connection and provides an API similar to JSTL A ScriptableConnection provides two methods:
fun
argument is provided to query
it
will be called for each row returned (the row object will be passed as its
argument). For example:
var db = Database.getConnection(...); var queryVal = ...; var startRow = 0; var maxRows = 100; db.query("select * from table where column = ?", [queryVal], startRow, maxRows, function(row) { print("column = " + row.column); });If
fun
is undefined, an object containing the following
properties will be returned instead:
Field Summary |
---|
Fields inherited from class org.mozilla.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface org.mozilla.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
ScriptableConnection()
|
|
ScriptableConnection(org.mozilla.javascript.Scriptable parent,
Connection conn)
|
Method Summary | |
---|---|
static void |
finishInit(org.mozilla.javascript.Scriptable proto)
|
Object |
get(int index,
org.mozilla.javascript.Scriptable start)
|
Object |
get(String name,
org.mozilla.javascript.Scriptable start)
|
String |
getClassName()
|
boolean |
has(int index,
org.mozilla.javascript.Scriptable start)
|
boolean |
has(String name,
org.mozilla.javascript.Scriptable start)
|
static org.mozilla.javascript.Scriptable |
jsConstructor(org.mozilla.javascript.Context cx,
Object[] args,
org.mozilla.javascript.Function ctorObj,
boolean inNewExpr)
|
Object |
jsFunction_query(String sql,
Object params,
int startRow,
int maxRows,
Object funObj)
|
int |
jsFunction_update(String sql,
Object params)
|
void |
put(String name,
org.mozilla.javascript.Scriptable start,
Object value)
|
Methods inherited from class org.mozilla.javascript.ScriptableObject |
---|
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScriptableConnection()
public ScriptableConnection(org.mozilla.javascript.Scriptable parent, Connection conn)
Method Detail |
---|
public String getClassName()
getClassName
in interface org.mozilla.javascript.Scriptable
getClassName
in class org.mozilla.javascript.ScriptableObject
public static void finishInit(org.mozilla.javascript.Scriptable proto)
public static org.mozilla.javascript.Scriptable jsConstructor(org.mozilla.javascript.Context cx, Object[] args, org.mozilla.javascript.Function ctorObj, boolean inNewExpr) throws Exception
Exception
public Object jsFunction_query(String sql, Object params, int startRow, int maxRows, Object funObj) throws org.mozilla.javascript.JavaScriptException
org.mozilla.javascript.JavaScriptException
public int jsFunction_update(String sql, Object params) throws org.mozilla.javascript.JavaScriptException
org.mozilla.javascript.JavaScriptException
public Object get(String name, org.mozilla.javascript.Scriptable start)
get
in interface org.mozilla.javascript.Scriptable
get
in class org.mozilla.javascript.ScriptableObject
public boolean has(String name, org.mozilla.javascript.Scriptable start)
has
in interface org.mozilla.javascript.Scriptable
has
in class org.mozilla.javascript.ScriptableObject
public boolean has(int index, org.mozilla.javascript.Scriptable start)
has
in interface org.mozilla.javascript.Scriptable
has
in class org.mozilla.javascript.ScriptableObject
public Object get(int index, org.mozilla.javascript.Scriptable start)
get
in interface org.mozilla.javascript.Scriptable
get
in class org.mozilla.javascript.ScriptableObject
public void put(String name, org.mozilla.javascript.Scriptable start, Object value)
put
in interface org.mozilla.javascript.Scriptable
put
in class org.mozilla.javascript.ScriptableObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |