public class OXQDDataSource extends java.lang.Object implements XQDataSource
XQDataSource
interface, for use with Oracle XML DB. The following property names are required to be set via the setProperty method, or other alternative methods of this class in order to specify Oracle XML DB connection info.Property Name | Property Value |
---|---|
driver | Only jdbc:oracle:thin is supported |
dbusername | Database schema (user) name |
dbpassword | Password for database schema |
dbserver | Hostname for database instance |
dbport | Port number for database instance |
dbname | Database instance name (service id). Either dbname or serviceName should be used |
serviceName | Service name. Either dbname or serviceName should be used |
OXQDDataSource oxqDS = new OXQDDataSource(); oxqDS.setProperty("driver", "jdbc:oracle:thin"); oxqDS.setProperty("dbusername", "oe"); oxqDS.setProperty("dbpassword", "oe"); oxqDS.setProperty("dbserver", "myMachine"); oxqDS.setProperty("dbport", "6479"); oxqDS.setProperty("serviceName", "myservice.oracle.com");
Constructor and Description |
---|
OXQDDataSource()
Create a new
OXQDataSource for connecting to XML DB. |
Modifier and Type | Method and Description |
---|---|
XQConnection |
getConnection()
Create a new
XQConnection object representing an XQJ connection to Oracle XML DB. |
XQConnection |
getConnection(java.sql.Connection con)
This method is not supported.
|
XQConnection |
getConnection(java.lang.String username, java.lang.String passwd)
Same as
getConnection() . |
java.lang.String |
getDBName()
Get the value of the db name property
|
java.lang.String |
getDBPassword()
Get the value of the db password property
|
java.lang.String |
getDBPort()
Get the value of the db port property
|
java.lang.String |
getDBServer()
Get the value of the db server property
|
java.lang.String |
getDBUserName()
Get the value of the db user name property
|
java.lang.String |
getDriver()
Get the value of the driver property
|
int |
getLoginTimeout()
Login timeout is not supported by this implementation.
|
java.io.PrintWriter |
getLogWriter()
Log writer is not supported by this implementation.
|
java.lang.String |
getProperty(java.lang.String name)
Gets the value of a supported property returned by
getSupportedPropertyNames() . |
java.lang.String |
getServiceName()
Get the value of the service name property
|
java.lang.String[] |
getSupportedPropertyNames()
Returns all supported property names.
|
void |
setDBName(java.lang.String dbname)
Set the value of the db name property
|
void |
setDBPassword(java.lang.String password)
Set the value of the db password property
|
void |
setDBPort(java.lang.String port)
Set the value of the db port property
|
void |
setDBServer(java.lang.String server)
Set the value of the db server property
|
void |
setDBUserName(java.lang.String username)
Set the value of the db user name property
|
void |
setDriver(java.lang.String driver)
Set the value of the driver property
|
void |
setLoginTimeout(int seconds)
This method is not supported.
|
void |
setLogWriter(java.io.PrintWriter out)
This method is not supported.
|
void |
setProperties(java.util.Properties props)
This method is not supported.
|
void |
setProperty(java.lang.String name, java.lang.String value)
Sets the value of a supported property returned by
getSupportedPropertyNames() . |
void |
setServiceName(java.lang.String serviceName)
Set the value of the service name property
|
public OXQDDataSource()
OXQDataSource
for connecting to XML DB.getConnection()
.public XQConnection getConnection() throws XQException
XQConnection
object representing an XQJ connection to Oracle XML DB.getConnection()
.getConnection
in interface XQDataSource
XQException
- if a datasource access error occurspublic XQConnection getConnection(java.sql.Connection con) throws XQException
getConnection
in interface XQDataSource
con
- an existing JDBC connectionXQException
- if (1) a datasource access error occurs, (2) the implementation does not support this method of getting an XQConnection
, or (3) if the con
parameter is null
public XQConnection getConnection(java.lang.String username, java.lang.String passwd) throws XQException
getConnection()
. The parameters are silently ignored in this implementation.getConnection
in interface XQDataSource
username
- the user on whose behalf the connection is being madepasswd
- the user's passwordXQException
- if a datasource access error occurspublic int getLoginTimeout() throws XQException
getLoginTimeout
in interface XQDataSource
XQException
- if a datasource access error occurspublic java.io.PrintWriter getLogWriter() throws XQException
getLogWriter
in interface XQDataSource
null
if logging is disabledXQException
- if a datasource access error occurspublic java.lang.String[] getSupportedPropertyNames()
getSupportedPropertyNames
in interface XQDataSource
String[]
containing supported property namespublic void setProperty(java.lang.String name, java.lang.String value) throws XQException
getSupportedPropertyNames()
. Properties contain the necessary information for establishing a connection to Oracle XML DB.setProperty
in interface XQDataSource
name
- the name of the property. See getSupportedPropertyNames()
for all supported properties.value
- the value of the property.XQException
- if (1) the given property is not recognized, (2) the value for the given property is determined to be invalid, or (3) the name
parameter is null
public java.lang.String getProperty(java.lang.String name) throws XQException
getSupportedPropertyNames()
. Properties contain the necessary information for establishing a connection to Oracle XML DB.getProperty
in interface XQDataSource
name
- the name of the property whose value is neededXQException
- if (1) a given property is not supported, or (2) the name parameter is null
public void setProperties(java.util.Properties props) throws XQException
setProperties
in interface XQDataSource
props
- the list of properties to setXQException
- if (1) a given property is not recognized, (2) the value for a given property is determined to be invalid, or (3) the props
parameter is null
public void setLoginTimeout(int seconds) throws XQException
setLoginTimeout
in interface XQDataSource
seconds
- the datasource login time limitXQException
- if a datasource access error occurspublic void setLogWriter(java.io.PrintWriter out) throws XQException
setLogWriter
in interface XQDataSource
out
- the new log writer; to disable logging, set to null
XQException
- if a datasource access error occurspublic java.lang.String getDriver()
public void setDriver(java.lang.String driver)
driver
- value of the driver propertypublic java.lang.String getDBUserName()
public void setDBUserName(java.lang.String username)
username
- value of the db user name propertypublic java.lang.String getDBPassword()
public void setDBPassword(java.lang.String password)
password
- value of the db password propertypublic java.lang.String getDBServer()
public void setDBServer(java.lang.String server)
server
- value of the db server propertypublic java.lang.String getDBPort()
public void setDBPort(java.lang.String port)
port
- value of the db port propertypublic java.lang.String getDBName()
public void setDBName(java.lang.String dbname)
dbname
- value of the db name propertypublic java.lang.String getServiceName()
public void setServiceName(java.lang.String serviceName)
serviceName
- value of the service name property