|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.api.xqj.BXQDataFactory
org.basex.api.xqj.BXQConnection
public final class BXQConnection
Java XQuery API - Connection.
Constructor Summary | |
---|---|
BXQConnection()
Constructor. |
Method Summary | |
---|---|
void |
close()
Closes the class. |
void |
commit()
Makes all changes made in the current transaction permanent and releases any locks held by the datasource. |
XQExpression |
createExpression()
Creates a new XQExpression object that can be used
to perform execute immediate operations with XQuery expressions. |
XQExpression |
createExpression(XQStaticContext sc)
Creates a new XQExpression object that can be used to
perform execute immediate operations with XQuery expressions. |
boolean |
getAutoCommit()
Gets the auto-commit attribute of this connection |
XQMetaData |
getMetaData()
Gets the metadata for this connection. |
XQStaticContext |
getStaticContext()
Gets an XQStaticContext representing the default values for
all expression properties. |
boolean |
isClosed()
Returns the closed flag. |
XQPreparedExpression |
prepareExpression(java.io.InputStream is)
Prepares an expression for execution. |
XQPreparedExpression |
prepareExpression(java.io.InputStream is,
XQStaticContext sc)
Prepares an expression for execution. |
XQPreparedExpression |
prepareExpression(java.io.Reader r)
Prepares an expression for execution. |
XQPreparedExpression |
prepareExpression(java.io.Reader r,
XQStaticContext sc)
Prepares an expression for execution. |
XQPreparedExpression |
prepareExpression(java.lang.String query)
Prepares an expression for execution. |
XQPreparedExpression |
prepareExpression(java.lang.String query,
XQStaticContext sc)
Prepares an expression for execution. |
void |
rollback()
Undoes all changes made in the current transaction and releases any locks held by the datasource. |
void |
setAutoCommit(boolean ac)
Sets the auto-commit attribute to the given state. |
void |
setStaticContext(XQStaticContext sc)
Sets the default values for all expression properties. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.xml.xquery.XQConnection |
---|
close, isClosed |
Constructor Detail |
---|
public BXQConnection()
Method Detail |
---|
public void commit() throws XQException
XQConnection
XQResultSequence
, or XQResultItem
may be
implicitly closed upon commit, if the holdability property of the
sequence is set to XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT
.
commit
in interface XQConnection
XQException
- if the connection is in a closed state
or this connection is operating in auto-commit modepublic XQExpression createExpression() throws XQException
XQConnection
XQExpression
object that can be used
to perform execute immediate operations with XQuery expressions.
The properties of the connection's default XQStaticContext
are
copied to the returned XQExpression
.
createExpression
in interface XQConnection
XQExpression
that can be used to execute
multiple expressions
XQException
- if the connection is in a closed statepublic XQExpression createExpression(XQStaticContext sc) throws XQException
XQConnection
XQExpression
object that can be used to
perform execute immediate operations with XQuery expressions. The
properties of the specified XQStaticContext
values are
copied to the returned XQExpression
.
createExpression
in interface XQConnection
sc
- XQStaticContext
containing
values of expression properties
XQExpression
that can be used to execute
multiple expressions
XQException
- if (1) the connection is in a closed state, or
(2) the specified argument is null
public boolean getAutoCommit()
XQConnection
getAutoCommit
in interface XQConnection
true
if the connection operates
in auto-commit mode; otherwise false
public XQMetaData getMetaData() throws XQException
XQConnection
getMetaData
in interface XQConnection
XQMetadata
representing the metadata of
this connection
XQException
- if the connection is in a closed statepublic XQStaticContext getStaticContext() throws XQException
XQConnection
XQStaticContext
representing the default values for
all expression properties. In order to modify the defaults, it is not
sufficient to modify the values in the returned
XQStaticContext
object; in addition
setStaticContext
should be called to make those new values
effective.
getStaticContext
in interface XQConnection
XQStaticContext
representing the
default values for all expression properties
XQException
- if the connection is in a closed statepublic XQPreparedExpression prepareExpression(java.io.InputStream is, XQStaticContext sc) throws XQException
XQConnection
The properties of the specified XQStaticContext
values are
copied to the returned XQPreparedExpression
.
prepareExpression
in interface XQConnection
is
- the XQuery expression as an InputStream
.
Cannot be null
sc
- XQStaticContext
containing
values of expression properties
XQException
- if (1) the connection is in a closed state, or
(2) the specified argument is null
public XQPreparedExpression prepareExpression(java.io.InputStream is) throws XQException
XQConnection
The properties of the connection's default XQStaticContext
are
copied to the returned XQPreparedExpression
.
prepareExpression
in interface XQConnection
is
- the XQuery expression as an InputStream
.
Cannot be null
XQException
- if (1) the connection is in a closed state,
(2) there are errors preparing the expression
or (3) the xquery parameter is null
public XQPreparedExpression prepareExpression(java.io.Reader r, XQStaticContext sc) throws XQException
XQConnection
The properties of the specified XQStaticContext
values are
copied to the returned XQPreparedExpression
.
prepareExpression
in interface XQConnection
r
- the XQuery expression as a Reader
.
Cannot be null
sc
- XQStaticContext
containing
values of expression properties
XQException
- if (1) the connection is in a closed state, or
(2) the specified argument is null
public XQPreparedExpression prepareExpression(java.io.Reader r) throws XQException
XQConnection
The properties of the connection's default XQStaticContext
are
copied to the returned XQPreparedExpression
.
prepareExpression
in interface XQConnection
r
- the XQuery expression as a Reader
.
Cannot be null
XQException
- if (1) the connection is in a closed state,
(2) there are errors preparing the expression,
or (3) the xquery parameter is null
public XQPreparedExpression prepareExpression(java.lang.String query, XQStaticContext sc) throws XQException
XQConnection
The properties of the specified XQStaticContext
values are
copied to the returned XQPreparedExpression
.
prepareExpression
in interface XQConnection
query
- the XQuery expression as a String
.
Cannot be null
sc
- XQStaticContext
containing
values of expression properties.
XQException
- if (1) the connection is in a closed state, or
(2) the specified argument is null
public XQPreparedExpression prepareExpression(java.lang.String query) throws XQException
XQConnection
The properties of the connection's default XQStaticContext
are
copied to the returned XQPreparedExpression
.
prepareExpression
in interface XQConnection
query
- the XQuery expression as a String
.
Cannot be null
XQException
- if (1) the connection is in a closed state,
(2) there are errors preparing the expression,
or (3) the xquery parameter is null
public void rollback() throws XQException
XQConnection
rollback
in interface XQConnection
XQException
- if the connection is in a closed state
or this connection is operating
in auto-commit modepublic void setAutoCommit(boolean ac) throws XQException
XQConnection
commit()
or rollback()
.setAutoCommit
is called and the auto-commit attribute is not changed from its
current value, the request is treated as a no-op.
setAutoCommit
in interface XQConnection
ac
- true
to enable auto-commit mode;
false
to disable it
XQException
- if (1) the connection is in a closed state,
or (2) auto-commit is turned off but the
implementation doesn't support transactionspublic void setStaticContext(XQStaticContext sc) throws XQException
XQConnection
XQStaticContext
and update its private copy.
setStaticContext
in interface XQConnection
sc
- XQStaticContext
containing
values of expression properties
XQException
- if the connection is in a closed statepublic final void close()
public final boolean isClosed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |