|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.marklogic.xdmp.XDMPDataSource
A DataSource for creating connections to a specific XDMP database. This class provides all the methods from javax.sql.DataSource, but doesn't actually implement that interface, since XDMP is fundamentally not a SQL datasource.
An XDMPDataSource object can be bound to a JNDI Context in the standard way. It can then be used by applications to get XDBCConnections without referencing hosts, ports, and other information directly from the code.
| Constructor Summary | |
XDMPDataSource()
Construct a new XDMPDataSource object. |
|
XDMPDataSource(String host,
int port)
Construct a new XDMPDataSource object. |
|
| Method Summary | |
XDBCConnection |
getConnection()
Attempts to establish a connection with the data source that this DataSource object represents. |
XDBCConnection |
getConnection(String username,
String password)
Attempts to establish a connection with the data source that this DataSource object represents. |
int |
getLoginTimeout()
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. |
PrintWriter |
getLogWriter()
Retrieves the log writer for this DataSource object. |
void |
setHost(String host)
Sets the hostname for connections created from this datasource. |
void |
setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. |
void |
setLogWriter(PrintWriter out)
Sets the log writer for this DataSource object to the given java.io.PrintWriter object. |
void |
setPassword(String password)
Sets the password for connections created from this datasource. |
void |
setPort(int port)
Sets the port number for connections created from this datasource. |
void |
setUserName(String username)
Sets the username for connections created from this datasource. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XDMPDataSource()
throws XDBCException
XDBCException - if the datasource cannot be created.
public XDMPDataSource(String host,
int port)
throws XDBCException
host - the hostname to use when creating connections.port - the port number to use when creating connections.
XDBCException - if the datasource cannot be created.| Method Detail |
public XDBCConnection getConnection()
throws XDBCException
XDBCException - if the connection cannot be made.
public XDBCConnection getConnection(String username,
String password)
throws XDBCException
username - a String username for authenticating the connection.password - a String password for authenticating the connection.
XDBCException - if the connection cannot be made.
public int getLoginTimeout()
throws XDBCException
XDBCException - if the timeout cannot be determined.
public void setLoginTimeout(int seconds)
throws XDBCException
seconds - the integer number of seconds to wait.
XDBCException - if the timeout cannot be set.
public PrintWriter getLogWriter()
throws XDBCException
XDBCException - if the PrintWriter cannot be retrieved.
public void setLogWriter(PrintWriter out)
throws XDBCException
out - the PrintWriter to use for logging.
XDBCException - if the PrintWriter cannot be set.public void setUserName(String username)
username - the String username for authenticating connections.public void setPassword(String password)
password - the String password for authenticating connections.public void setHost(String host)
host - the String host to connect to.public void setPort(int port)
port - the integer port number to connect to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||