|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
oracle.jdbc.pool.OracleDataSource
A DataSource object is a factory for Connection objects. An object that implements the DataSource interface will typically be registered with a JNDI service provider. A JDBC driver that is accessed via the DataSource API does not automatically register itself with the DriverManager.
Constructor Summary | |
OracleDataSource()
|
Method Summary | |
java.sql.Connection |
getConnection()
Attempt to establish a database connection. |
java.sql.Connection |
getConnection(java.lang.String user,
java.lang.String passwd)
Attempt to establish a database connection. |
java.lang.String |
getDatabaseName()
Get the name of the database set on this DataSource instance. |
java.lang.String |
getDataSourceName()
Get the datasource name for this instance if set. |
java.lang.String |
getDescription()
Get the Desciption of this data source. |
java.lang.String |
getDriverType()
Get the Oracle JDBC driver type set for this datasource instance |
boolean |
getExplicitCachingEnabled()
getExplicitCachingEnabled Returns the current value of the explicitCachingEnabled property. |
boolean |
getImplicitCachingEnabled()
getImplicitCachingEnabled Returns the current value of the implicitCachingEnabled property. |
int |
getLoginTimeout()
u Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. |
java.io.PrintWriter |
getLogWriter()
Get the log writer for this data source. |
int |
getMaxStatements()
getMaxStatements Returns the current value of the maxStatements property. |
java.lang.String |
getNetworkProtocol()
Get the network protocol set. |
int |
getPortNumber()
Get the port number on which server is listening for requests. |
oracle.jdbc.pool.Reference |
getReference()
|
java.lang.String |
getServerName()
Get the name of the server on which database is running. |
java.lang.String |
getServiceName()
Get the service_name To distinguish services from instances, a new URL using service_name is added, existing url with SID will be supported, but deprecated. |
java.lang.String |
getTNSEntryName()
Get the TNS entry name for this instance if set. |
java.lang.String |
getURL()
Get the URL for this datasource. |
java.lang.String |
getUser()
Get the user name for this datasource. |
void |
setDatabaseName(java.lang.String dsname)
Set the name of a particular database on a server. |
void |
setDataSourceName(java.lang.String dsname)
Set the DataSourceName. |
void |
setDescription(java.lang.String des)
Set the Desciption for this data source instance. |
void |
setDriverType(java.lang.String dt)
Set the JDBC driver type. |
void |
setExplicitCachingEnabled(boolean cache)
setExplicitCachingEnabled Sets the value of the explicitCachingEnabled property, which enables or disables the explicit cache. |
void |
setImplicitCachingEnabled(boolean cache)
setImplicitCachingEnabled Sets the value of the implicitCachingEnabled property, which enables or disables the implicit cache. |
void |
setLoginTimeout(int timeout)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. |
void |
setLogWriter(java.io.PrintWriter pw)
Set the log writer for this data source. |
void |
setMaxStatements(int max)
setMaxStatements Specifies the value of the maxStatements property. |
void |
setNetworkProtocol(java.lang.String np)
Set the network protocol for the connections. |
void |
setPassword(java.lang.String pd)
Set the password with which connections have to be obtained. |
void |
setPortNumber(int pn)
Set the port number where a server is listening for requests. |
void |
setServerName(java.lang.String sn)
Set the name of the Server on which database is running. |
void |
setServiceName(java.lang.String svcname)
Set the service_name of a database on a server. |
void |
setTNSEntryName(java.lang.String dbname)
Set the TNS entry name. |
void |
setURL(java.lang.String url)
Set the URL from which connections have to be obtained. |
void |
setUser(java.lang.String user)
Set the user name with which connections have to be obtained. |
Constructor Detail |
public OracleDataSource() throws java.sql.SQLException
Method Detail |
public java.sql.Connection getConnection() throws java.sql.SQLException
Attempt to establish a database connection.
public java.sql.Connection getConnection(java.lang.String user, java.lang.String passwd) throws java.sql.SQLException
Attempt to establish a database connection.
user
- the database user on whose behalf the Connection is
being madepassword
- the user's passwordpublic int getLoginTimeout()
public void setLoginTimeout(int timeout)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise it specifies that there is no timeout. When a DataSource object is created the login timeout is initially zero.
seconds
- the data source login time limitpublic void setLogWriter(java.io.PrintWriter pw)
Set the log writer for this data source.
The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a DataSource object is created the log writer is initially null, in other words, logging is disabled.
out
- the new log writer; to disable, set to nullpublic java.io.PrintWriter getLogWriter()
Get the log writer for this data source.
The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a DataSource object is created the log writer is initially null, in other words, logging is disabled.
public void setTNSEntryName(java.lang.String dbname)
dbname
- tns entry namepublic java.lang.String getTNSEntryName()
public void setDataSourceName(java.lang.String dsname)
dsname
- DataSource Name to be set.public java.lang.String getDataSourceName()
public java.lang.String getDatabaseName()
public void setDatabaseName(java.lang.String dsname)
If URL is set, this property will be ignored.
dsname
- database name to be set.public void setServiceName(java.lang.String svcname)
svcname
- service_name to be set.public java.lang.String getServiceName()
public void setServerName(java.lang.String sn)
sn
- server/host name to be set.public java.lang.String getServerName()
public void setURL(java.lang.String url)
url
- URL to be set.public java.lang.String getURL() throws java.sql.SQLException
public void setUser(java.lang.String user)
user
- Username to be set.public java.lang.String getUser()
public void setPassword(java.lang.String pd)
pd
- Passowrd to be set.public java.lang.String getDescription()
public void setDescription(java.lang.String des)
des
- Desciption to be set.public java.lang.String getDriverType()
public void setDriverType(java.lang.String dt)
If set to kprb, nothing else is needed to open a connection. This is meant for Server side JDBC driver when running inside server.
If set to thin, serverName, portNumber and databaseName are need to open a connection.
If set to oci, and network protocol is set to IPC or TNSEntryName is set then nothing else is needed. If not, serverName, portNumber and databaseName have to be provided.
dt
- Driver Type tp be set.public java.lang.String getNetworkProtocol()
public void setNetworkProtocol(java.lang.String np)
np
- set the network protocol to be used.public void setPortNumber(int pn)
pn
- port number on which server is listeningpublic int getPortNumber()
public oracle.jdbc.pool.Reference getReference() throws oracle.jdbc.pool.NamingException
public void setMaxStatements(int max) throws java.sql.SQLException
max
- Requested size of the cache. If the existing cache size
is less than max, statements will be purged to reduce the
size.public int getMaxStatements() throws java.sql.SQLException
public void setImplicitCachingEnabled(boolean cache) throws java.sql.SQLException
cache
- If true, then implicit caching will be enabled. If false,
then any existing statements will be purged and the implicit
cache will be disabled.public boolean getImplicitCachingEnabled() throws java.sql.SQLException
public void setExplicitCachingEnabled(boolean cache) throws java.sql.SQLException
cache
- If true, then explicit caching will be enabled. If false,
then any existing statements will be purged and the explicit
cache will be disabled.public boolean getExplicitCachingEnabled() throws java.sql.SQLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |