Class SQLConnect.ConnectInstruction
- java.lang.Object
-
- net.sf.saxon.expr.Expression
-
- net.sf.saxon.expr.SimpleExpression
-
- net.sf.saxon.option.sql.SQLConnect.ConnectInstruction
-
- All Implemented Interfaces:
Callable
,ExportAgent
,Locatable
,IdentityComparable
,Traceable
- Enclosing class:
- SQLConnect
public static class SQLConnect.ConnectInstruction extends SimpleExpression
-
-
Field Summary
Fields Modifier and Type Field Description static int
AUTOCOMMIT
static int
DATABASE
static int
DRIVER
static int
PASSWORD
static int
USER
-
Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
-
-
Constructor Summary
Constructors Constructor Description ConnectInstruction(Expression database, Expression driver, Expression user, Expression password, Expression autoCommit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExternalObject<java.sql.Connection>
call(XPathContext context, Sequence[] arguments)
Call the Callable.int
computeCardinality()
Determine the static cardinality of the expression.SQLConnect.ConnectInstruction
copy(RebindingMap rebindings)
Copy an expression.java.lang.String
getExpressionType()
Return a distinguishing name for the expression, for use in diagnostics.int
getImplementationMethod()
A subclass must provide one of the methods evaluateItem(), iterate(), or process().-
Methods inherited from class net.sf.saxon.expr.SimpleExpression
copyOperandsFrom, evaluateItem, export, getItemType, getOperanda, iterate, operands, process, setArguments, setOperanda
-
Methods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeHashCode, computeSpecialProperties, computeStaticProperties, dynamicError, effectiveBooleanValue, equals, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExpressionName, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operandSparseList, optimize, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toString, typeCheck, typeCheckChildren, typeError, unordered, verifyParentPointers
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
-
-
-
Field Detail
-
DATABASE
public static final int DATABASE
- See Also:
- Constant Field Values
-
DRIVER
public static final int DRIVER
- See Also:
- Constant Field Values
-
USER
public static final int USER
- See Also:
- Constant Field Values
-
PASSWORD
public static final int PASSWORD
- See Also:
- Constant Field Values
-
AUTOCOMMIT
public static final int AUTOCOMMIT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConnectInstruction
public ConnectInstruction(Expression database, Expression driver, Expression user, Expression password, Expression autoCommit)
-
-
Method Detail
-
getImplementationMethod
public int getImplementationMethod()
A subclass must provide one of the methods evaluateItem(), iterate(), or process(). This method indicates which of the three is provided.- Specified by:
getImplementationMethod
in classExpression
- Returns:
- the implementation method, for example
Expression.ITERATE_METHOD
orExpression.EVALUATE_METHOD
orExpression.PROCESS_METHOD
-
computeCardinality
public int computeCardinality()
Description copied from class:SimpleExpression
Determine the static cardinality of the expression. This implementation returns "zero or more", which can be overridden in a subclass.- Overrides:
computeCardinality
in classSimpleExpression
- Returns:
- the computed cardinality, as one of the values
StaticProperty.ALLOWS_ZERO_OR_ONE
,StaticProperty.EXACTLY_ONE
,StaticProperty.ALLOWS_ONE_OR_MORE
,StaticProperty.ALLOWS_ZERO_OR_MORE
. May also returnStaticProperty.ALLOWS_ZERO
if the result is known to be an empty sequence, orStaticProperty.ALLOWS_MANY
if if is known to return a sequence of length two or more.
-
getExpressionType
public java.lang.String getExpressionType()
Description copied from class:SimpleExpression
Return a distinguishing name for the expression, for use in diagnostics. By default the class name is used.- Overrides:
getExpressionType
in classSimpleExpression
- Returns:
- a distinguishing name for the expression (defaults to the name of the implementation class)
-
copy
public SQLConnect.ConnectInstruction copy(RebindingMap rebindings)
Description copied from class:SimpleExpression
Copy an expression. This makes a deep copy.- Overrides:
copy
in classSimpleExpression
- Parameters:
rebindings
- variables that need to be re-bound- Returns:
- the copy of the original expression
-
call
public ExternalObject<java.sql.Connection> call(XPathContext context, Sequence[] arguments) throws XPathException
Description copied from interface:Callable
Call the Callable.- Parameters:
context
- the dynamic evaluation contextarguments
- the values of the arguments, supplied as Sequences.Generally it is advisable, if calling iterate() to process a supplied sequence, to call it only once; if the value is required more than once, it should first be converted to a
GroundedValue
by calling the utility method SequenceTool.toGroundedValue().If the expected value is a single item, the item should be obtained by calling Sequence.head(): it cannot be assumed that the item will be passed as an instance of
Item
orAtomicValue
.It is the caller's responsibility to perform any type conversions required to convert arguments to the type expected by the callee. An exception is where this Callable is explicitly an argument-converting wrapper around the original Callable.
- Returns:
- the result of the evaluation, in the form of a Sequence. It is the responsibility of the callee to ensure that the type of result conforms to the expected result type.
- Throws:
XPathException
- if a dynamic error occurs during the evaluation of the expression
-
-