|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.marklogic.xdmp.XDMPConnection
A connection (session) with a specific contentbase and port. Within the context of an XDBCConnection, XQuery statements are executed and results are returned.
An XDBCConnection's contentbase will provide information describing its XQuery compliance level and the capabilities of the connection with the 'getMetaData' method.
An XDMPConnection is threadsafe. It represents a socket, and each socket is pooled and assigned an XDMPConnection whenever it executes a query. Therefore, it is OK to share database connections across threads.
| Field Summary |
| Fields inherited from interface com.marklogic.xdbc.XDBCConnection |
XDBC_TRANSACTION_NONE, XDBC_TRANSACTION_READ_COMMITTED, XDBC_TRANSACTION_READ_UNCOMMITTED, XDBC_TRANSACTION_REPEATABLE_READ, XDBC_TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
XDMPConnection(String host,
int port)
Constructor for XDMPConnection object. |
|
XDMPConnection(String host,
int port,
String prompt)
Constructor for XDMPConnection object. |
|
XDMPConnection(String host,
int port,
String user,
String password)
Constructor for XDMPConnection object. |
|
| Method Summary | |
void |
clearWarnings()
Clears all warnings reported for this XDBCConnection object. |
void |
close()
Releases a XDBCConnection's database and XDBC resources immediately instead of waiting for them to be automatically released. |
void |
commit()
NOTE: This method is NOT currently supported. |
XDBCStatement |
createStatement()
Creates a Statement object for sending XQuery expressions to the database. |
protected void |
finalize()
Finalizer for XDMPConnection. |
boolean |
getAutoCommit()
Gets the current auto-commit state of this connection. |
String |
getHost()
Gets the host associated with this connection. |
Locale |
getLocale()
Gets the locale associated with this database connection. |
static int |
getMaxOpenDocInsertStreams()
Returns the maximum allowable number of open doc insert stream objects at any one time. |
static int |
getMaxOpenResultSequences()
Returns the maximum allowable number of open result sequence objects at any one time |
XDBCDatabaseMetaData |
getMetaData()
Gets the metadata regarding this connection's database. |
int |
getPort()
Gets the port number of this connection. |
TimeZone |
getTimeZone()
Gets the timezone associated with this database connection. |
int |
getTransactionIsolation()
Return the database's default transaction isolation level. |
XDBCWarning |
getWarnings()
Returns the first warning reported by calls on this XDMPConnection. |
boolean |
isClosed()
Tests if this XDBCConnection is closed. |
boolean |
isReadOnly()
Tests if this XDBCConnection is in read-only mode. |
XDMPDocInsertStream |
openDocInsertStream()
Opens a document insert stream to insert multiple documents in the database in a single transaction. |
XDMPDocInsertStream |
openDocInsertStream(String uri)
Opens a document insert stream to insert a document in the database. |
XDMPDocInsertStream |
openDocInsertStream(String uri,
Locale locale)
Deprecated. As of XDBC 3.0, replaced by XDMPDocOptions |
XDMPDocInsertStream |
openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities)
Deprecated. As of XDBC 3.0, replaced by XDMPDocOptions |
XDMPDocInsertStream |
openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
String[] collections)
Deprecated. As of XDBC 3.0, replaced by XDMPDocOptions |
XDMPDocInsertStream |
openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions)
Deprecated. As of XDBC 3.0, replaced by XDMPDocOptions |
XDMPDocInsertStream |
openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions,
String[] collections)
Deprecated. As of XDBC 3.0, replaced by XDMPDocOptions |
XDMPDocInsertStream |
openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions,
String[] collections,
int quality,
String namespace,
int repair)
Deprecated. As of XDBC 3.0, replaced by XDMPDocOptions |
XDMPDocInsertStream |
openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions,
String[] collections,
int quality,
String namespace,
int repair,
String[] placeKeys)
Deprecated. As of XDBC 3.0, replaced by XDMPDocOptions |
XDMPDocInsertStream |
openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions,
String[] collections,
int quality,
String namespace,
int repair,
String[] placeKeys,
int format,
String language)
Deprecated. As of XDBC 3.0, replaced by XDMPDocOptions |
XDMPDocInsertStream |
openDocInsertStream(String uri,
XDMPDocOptions docOpts)
Opens a document insert stream to insert a document in the database. |
void |
rollback()
NOTE: This method is NOT currently supported. |
void |
setAutoCommit(boolean autoCommit)
NOTE: This method is NOT currently supported. |
void |
setLocale(Locale locale)
Sets the locale for this connection object. |
static void |
setMaxOpenDocInsertStreams(int n)
Sets the maximum allowable number of open doc insert stream objects at any one time. |
static void |
setMaxOpenResultSequences(int n)
Sets the maximum allowable number of open result sequence objects at any one time. |
void |
setReadOnly(boolean readOnly)
NOTE: This method is NOT currently supported. |
void |
setTimeZone(TimeZone tz)
Sets the timezone for this connection object. |
void |
setTransactionIsolation(int level)
NOTE: This method is NOT currently supported. |
String |
toString()
Returns a string representation of the connection object. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public XDMPConnection(String host,
int port,
String prompt)
throws XDBCException
host - a valid hostname with a Mark Logic XDMP server installed and
runningport - the port number of the Mark Logic XDMP server.prompt - a prompt provided to select the appropriate credentials
to use.
XDBCException - if a database connection error occurs.XDMPAuthenticator.setCredentials(java.lang.String, int, java.lang.String, java.lang.String, java.lang.String)
public XDMPConnection(String host,
int port)
throws XDBCException
host - a valid hostname with a Mark Logic XDMP server installed and
runningport - the port number of the Mark Logic XDMP server.
XDBCException - if a database connection error occurs.
public XDMPConnection(String host,
int port,
String user,
String password)
throws XDBCException
host - a valid hostname with a Mark Logic XDMP server installed and
runningport - the port number of the Mark Logic XDMP server.user - the user to connect as.password - the password to connect with.
XDBCException - if a database connection error occurs.XDMPAuthenticator.setCredentials(java.lang.String, int, java.lang.String, java.lang.String, java.lang.String)| Method Detail |
protected void finalize()
public void close()
throws XDBCException
close in interface XDBCConnectionXDBCException - if a database access error occurs.
public void commit()
throws XDBCException
NOTE: This method is NOT currently supported.
Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the connection.
commit in interface XDBCConnectionXDBCException - if a database access error occurs.
public XDBCStatement createStatement()
throws XDBCException
createStatement in interface XDBCConnectionXDBCException - if a database access error occurs.
public XDMPDocInsertStream openDocInsertStream()
throws XDBCException
XDBCException - if a database access error occurs.XDMPDocInsertStream.newDocument(String,
com.marklogic.xdmp.XDMPDocOptions),
XDMPDocInsertStream.commit()
public XDMPDocInsertStream openDocInsertStream(String uri)
throws XDBCException
uri - a URI by which the document will be known to the
database after it is inserted.
XDBCException - if a database access error occurs.
public XDMPDocInsertStream openDocInsertStream(String uri,
XDMPDocOptions docOpts)
throws XDBCException
uri - a URI by which the document will be known to the
database after it is inserted.docOpts - an XDMPDocOptions object to use when loading
the document. The XDMPDocOptions object contains options
to set for the document when it is loaded.
XDBCException - if a database access error occurs.XDMPDocOptions
public XDMPDocInsertStream openDocInsertStream(String uri,
Locale locale)
throws XDBCException
XDMPDocOptions
uri - a URI by which the document will be known to the
database after it is inserted.locale - a locale to use when loading the document. If
null, the default Java virtual machine locale is used.
XDBCException - if a database access error occurs.
public XDMPDocInsertStream openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities)
throws XDBCException
XDMPDocOptions
uri - a URI by which the document will be known to the
database after it is inserted.locale - a locale to use when loading the document. If
null, the default Java virtual machine local is used.resolveEntities - boolean if true, external entities
embedded in the document should be resolved. The default is
false.
XDBCException - if a database access error occurs.
public XDMPDocInsertStream openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions)
throws XDBCException
XDMPDocOptions
uri - a URI by which the document will be known to the
database after it is inserted.locale - a locale to use when loading the document. If
null, the default Java virtual machine local is used.resolveEntities - boolean if true, external entities
embedded in the document should be resolved. The default is
false.permissions - specifies the permissions on the document.
An empty array indicates no permissions and null causes the
server defaults to be used.
XDBCException - if a database access error occurs.
public XDMPDocInsertStream openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
String[] collections)
throws XDBCException
XDMPDocOptions
uri - a URI by which the document will be known to the
database after it is inserted.locale - a locale to use when loading the document. If
null, the default Java virtual machine local is used.resolveEntities - boolean if true, external entities
embedded in the document should be resolved. The default is
false.collections - specifies the collections for the document.
An empty array indicates no collections and null causes the
server defaults to be used.
XDBCException - if a database access error occurs.
public XDMPDocInsertStream openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions,
String[] collections)
throws XDBCException
XDMPDocOptions
uri - a URI by which the document will be known to the
database after it is inserted.locale - a locale to use when loading the document. If
null, the default Java virtual machine local is used.resolveEntities - boolean if true, external entities
embedded in the document should be resolved. The default is
false.permissions - specifies the permissions on the document.
An empty array indicates no permissions and null causes the
server defaults to be used.collections - specifies the collections for the document.
An empty array indicates no collections and null causes the
server defaults to be used.
XDBCException - if a database access error occurs.
public XDMPDocInsertStream openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions,
String[] collections,
int quality,
String namespace,
int repair)
throws XDBCException
XDMPDocOptions
uri - a URI by which the document will be known to the
database after it is inserted.locale - a locale to use when loading the document. If
null, the default Java virtual machine local is used.resolveEntities - boolean if true, external entities
embedded in the document should be resolved. The default is
false.permissions - specifies the permissions on the document.
An empty array indicates no permissions and null causes the
server defaults to be used.collections - specifies the collections for the document.
An empty array indicates no collections and null causes the
server defaults to be used.quality - specifies the integer quality value to assign to
the document being loaded. The default value is 0.namespace - specifies the namespace for elements in the
document being loaded. If null, the default namespace is used.repair - the level of error correction to be performed on
the document being loaded. Default is XDMP_ERROR_CORRECTION_FULL.
XDBCException - if a database access error occurs.XDMP_ERROR_CORRECTION_NONE,
XDMP_ERROR_CORRECTION_FULL
public XDMPDocInsertStream openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions,
String[] collections,
int quality,
String namespace,
int repair,
String[] placeKeys)
throws XDBCException
XDMPDocOptions
uri - a URI by which the document will be known to the
database after it is inserted.locale - a locale to use when loading the document. If
null, the default Java virtual machine local is used.resolveEntities - boolean if true, external entities
embedded in the document should be resolved. The default is
false.permissions - specifies the permissions on the document.
An empty array indicates no permissions and null causes the
server defaults to be used.collections - specifies the collections for the document.
An empty array indicates no collections and null causes the
server defaults to be used.quality - specifies the integer quality value to assign to
the document being loaded. The default value is 0.namespace - specifies the namespace for elements in the
document being loaded. If null, the default namespace is used.repair - the level of error correction to be performed on
the document being loaded. Default is XDMP_ERROR_CORRECTION_FULL.placeKeys - the String array of keys of the forest into
which the document should be inserted. If null or an empty array
is specified, the server chooses the forest.
XDBCException - if a database access error occurs.XDMP_ERROR_CORRECTION_NONE,
XDMP_ERROR_CORRECTION_FULL
public XDMPDocInsertStream openDocInsertStream(String uri,
Locale locale,
boolean resolveEntities,
XDMPPermission[] permissions,
String[] collections,
int quality,
String namespace,
int repair,
String[] placeKeys,
int format,
String language)
throws XDBCException
XDMPDocOptions
uri - a URI by which the document will be known to the
database after it is inserted.locale - a locale to use when loading the document. If
null, the default Java virtual machine local is used.resolveEntities - boolean if true, external entities
embedded in the document should be resolved. The default is
false.permissions - specifies the permissions on the document.
An empty array indicates no permissions and null causes the
server defaults to be used.collections - specifies the collections for the document.
An empty array indicates no collections and null causes the
server defaults to be used.quality - specifies the integer quality value to assign to
the document being loaded. The default value is 0.namespace - specifies the namespace for elements in the
document being loaded. If null, the default namespace is used.repair - the level of error correction to be performed on
the document being loaded. Default is XDMP_ERROR_CORRECTION_FULL.placeKeys - the String array of keys of the forest into
which the document should be inserted. If null or an empty array
is specified, the server chooses the forest.format - integer constant specifying which format to treat
the document as, when inserted. The default is XDMP_DOC_FORMAT_NONE,
which means the uri suffix is used to determine the document type.language - the String language that will be used to perform
searches and stemming on the document. The value of this parameter
is usually the first two characters of the Locale (e.g. "en" for
English.) as obtained from java.util.Locale.getLanguage(). See
ISO 639 for specific values. If null, the default server language
is used.
XDBCException - if a database access error occurs.XDMP_ERROR_CORRECTION_NONE,
XDMP_ERROR_CORRECTION_FULL,
XDMP_DOC_FORMAT_BINARY,
XDMP_DOC_FORMAT_TEXT,
XDMP_DOC_FORMAT_XML
public boolean getAutoCommit()
throws XDBCException
getAutoCommit in interface XDBCConnectionXDBCException - if a database access error occurs.
public String getHost()
throws XDBCException
getHost in interface XDBCConnectionXDBCException - if a database access error occurs.
public Locale getLocale()
throws XDBCException
getLocale in interface XDBCConnectionXDBCException - if a database access error occurs.java.util.Locale
public TimeZone getTimeZone()
throws XDBCException
getTimeZone in interface XDBCConnectionXDBCException - if a database access error occursjava.util.TimeZone
public XDBCDatabaseMetaData getMetaData()
throws XDBCException
getMetaData in interface XDBCConnectionXDBCException - if a database access error occurs.
public int getPort()
throws XDBCException
getPort in interface XDBCConnectionXDBCException - if a database access error occurs.
public int getTransactionIsolation()
throws XDBCException
getTransactionIsolation in interface XDBCConnectionXDBCException - if a database access error occurs.XDBC_TRANSACTION_NONE,
XDBC_TRANSACTION_READ_UNCOMMITTED,
XDBC_TRANSACTION_READ_COMMITTED,
XDBC_TRANSACTION_REPEATABLE_READ,
XDBC_TRANSACTION_SERIALIZABLE
public void setTransactionIsolation(int level)
throws XDBCException
NOTE: This method is NOT currently supported.
Attempts to change the transaction isolation level to the one given.
setTransactionIsolation in interface XDBCConnectionlevel - the integer transaction isolation level to set on this
XDBCConnection
XDBCException - if a database access error occurs.
UnsupportedOperationException - if an attempt is made
to change the transaction isolation level.XDBC_TRANSACTION_NONE,
XDBC_TRANSACTION_READ_UNCOMMITTED,
XDBC_TRANSACTION_READ_COMMITTED,
XDBC_TRANSACTION_REPEATABLE_READ,
XDBC_TRANSACTION_SERIALIZABLE
public XDBCWarning getWarnings()
throws XDBCException
getWarnings in interface XDBCConnectionXDBCException - if a database access error occurs.
public void clearWarnings()
throws XDBCException
clearWarnings in interface XDBCConnectionXDBCException - if a database access error occurs.
public boolean isClosed()
throws XDBCException
isClosed in interface XDBCConnectionXDBCException - if a database access error occurs.
public boolean isReadOnly()
throws XDBCException
isReadOnly in interface XDBCConnectionXDBCException - if a database access error occurs.
public void rollback()
throws XDBCException
NOTE: This method is NOT currently supported.
Drop all changes made since the previous commit/rollback and releases any database locks currently held by this XDBCConnection.
rollback in interface XDBCConnectionXDBCException - if a database access error occurs.
public void setAutoCommit(boolean autoCommit)
throws XDBCException
NOTE: This method is NOT currently supported.
Sets this connection's auto-commit mode.
setAutoCommit in interface XDBCConnectionautoCommit - true to enable auto-commit mode for this
XDBCConnection; false to disable auto-commit mode.
XDBCException - if a database access error occurs.
UnsupportedOperationException - if an attempt is made
to change the auto-commit mode.
public void setLocale(Locale locale)
throws XDBCException
Generally, the locale needs to be changed before creating a statement or other operation, for which the new locale is needed.
setLocale in interface XDBCConnectionlocale - a locale to use when loading the document. If
null, the default Java virtual machine local is used.
XDBCException - if a database access error occurs.Locale
public void setTimeZone(TimeZone tz)
throws XDBCException
Generally, the timezone needs to be changed before creating a statement or other operation, for which the new timezone is needed.
setTimeZone in interface XDBCConnectiontz - the java.util.TimeZone object to use for with this
connection object.
XDBCException - if a database access error occursTimeZone
public void setReadOnly(boolean readOnly)
throws XDBCException
NOTE: This method is NOT currently supported.
Puts this connection in read-only mode as a hint to enable database optimizations.
setReadOnly in interface XDBCConnectionreadOnly - true to enable read-only mode for this
XDBCConnection; false to disable read-only mode.
XDBCException - if a database access error occurs.
UnsupportedOperationException - if an attempt is made
to change the read-only mode.public String toString()
public static void setMaxOpenResultSequences(int n)
n - the number of open result sequences.public static int getMaxOpenResultSequences()
public static void setMaxOpenDocInsertStreams(int n)
n - the number of open result sequences.public static int getMaxOpenDocInsertStreams()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||