|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.intersys.jdbc.CacheDataSource
CacheDataSource
object is an implementation of DataSource
interface.
In addition to the apis defined by the interface, this class also includes a number
of Cache specific apis that can be used to set up the DataSource
properties (setters) or get the information about the DataSource
object properties (getters). In order to be able to connect, at least server name
and database name properties must be defined, either by using the corresponding
setters, or by supplying a valid url (same as what would be used when connecting
via Driver
class).
Port number is optional, and defaults to 1972.
Username and Password can be set via the setters, or alternatively, can be
supplied via the getConnection api.
Description and DataSource name are completely optional and are not used by
CacheDataSource
object in order to connect.
Logging can be enabled by setting the LogWritter, and Login Timeout set by calling
the corresponding setter (both are optional).
Cache also provides a way to set the TCP nodelay flag. Toggling this flag can
affect the performance of this application. If not set, it defaults to true.
Event Class is a mechanism specific to Cache JDBC. It is completely optional, and
the vast majority of applications will not need this feature. See setEventClass for
more info on Event Class objects.
Constructor Summary | |
CacheDataSource()
|
Method Summary | |
Connection |
getConnection()
|
Connection |
getConnection(String usr,
String pwd)
|
int |
getConnectionSecurityLevel()
Returns an int representing current Connection Security Level setting. |
String |
getDatabaseName()
Returns a String representing the current database (Cache Namespace) name. |
String |
getDataSourceName()
Returns a String representing the current Data Source name. |
String |
getDescription()
Returns a String representing the current description. |
String |
getEventClass()
Returns a String representing an Event Class object. |
int |
getLoginTimeout()
|
PrintWriter |
getLogWriter()
|
boolean |
getNodelay()
Returns a boolean representing a current nodelay flag setting. |
String |
getPassword()
Returns a String representing the current password. |
int |
getPortNumber()
Returns an int representing the current port number. |
String |
getServerName()
Returns a String representing the current server name. |
String |
getServicePrincipalName()
Returns a String representing current Service Principal Name setting. |
String |
getURL()
Returns a String representing a current URL for this DataSource object. |
String |
getUser()
Returns a String representing the current username. |
void |
setConnectionSecurityLevel(int level)
Sets the Connection Security Level for this DataSource object. |
void |
setDatabaseName(String databaseName)
Sets Database (Cache Namespace) name for this DataSource object. |
void |
setDataSourceName(String dataSourceName)
Sets Data Source name for this DataSource object. |
void |
setDescription(String desc)
Sets description for this DataSource object. |
void |
setEventClass(String eventClassName)
Sets the Event Class for this DataSource object. |
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(PrintWriter out)
|
void |
setNodelay(boolean noDelay)
Sets the noDelay flag for this DataSource object. |
void |
setPassword(String pwd)
Sets the password for this DataSource object. |
void |
setPortNumber(int portNumber)
Sets the port number for this DataSource object |
void |
setServerName(String serverName)
Sets the server name for this DataSource object. |
void |
setServicePrincipalName(String name)
Sets the Service Principal Name for this DataSource object. |
void |
setURL(String u)
Sets the url for this DataSource object. |
void |
setUser(String username)
Sets the username for this DataSource object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CacheDataSource()
Method Detail |
public Connection getConnection() throws SQLException
getConnection
in interface javax.sql.DataSource
SQLException
public Connection getConnection(String usr, String pwd) throws SQLException
getConnection
in interface javax.sql.DataSource
SQLException
public PrintWriter getLogWriter()
getLogWriter
in interface javax.sql.DataSource
public void setLogWriter(PrintWriter out)
setLogWriter
in interface javax.sql.DataSource
public void setLoginTimeout(int seconds)
setLoginTimeout
in interface javax.sql.DataSource
public int getLoginTimeout()
getLoginTimeout
in interface javax.sql.DataSource
public void setDatabaseName(String databaseName)
DataSource
object.
databaseName
- database (Cache namespace) namepublic String getDatabaseName()
String
representing the current database (Cache Namespace) name.
public void setDataSourceName(String dataSourceName)
DataSource
object.
dataSourceName
- DataSource
namepublic String getDataSourceName()
String
representing the current Data Source name.
DataSource
namepublic void setDescription(String desc)
DataSource
object.
desc
- DataSource
descriptionpublic String getDescription()
String
representing the current description.
public void setPassword(String pwd)
DataSource
object.
pwd
- passwordpublic String getPassword()
String
representing the current password.
public void setPortNumber(int portNumber)
DataSource
object
portNumber
- port numberpublic int getPortNumber()
int
representing the current port number.
public void setServerName(String serverName)
DataSource
object.
serverName
- server namepublic String getServerName()
String
representing the current server name.
public void setUser(String username)
DataSource
object.
username
- usernamepublic String getUser()
String
representing the current username.
public void setEventClass(String eventClassName)
DataSource
object.
Cache JDBC server will dispatch to methods implemented in a class when
a transaction is about to be committed and when a transaction is about
to be rolled back. The class in which these methods are implemented is
referred to as the 'event class'. If an event class is specified during
login then the JDBC server will dispatch to %OnTranCommit just prior to
committing the current transaction and will dispatch to %OnTranRollback
just prior to rolling back (aborting) the current transaction. User
event classes should extend %ServerEvent. The methods do not return any
values and cannot abort the current transaction.
eventClassName
- event class namepublic String getEventClass()
String
representing an Event Class object.
public void setURL(String u) throws SQLException
DataSource
object.
u
- url
SQLException
public String getURL()
String
representing a current URL for this DataSource
object.
public void setNodelay(boolean noDelay)
DataSource
object.
noDelay
- nodelay flagpublic boolean getNodelay()
boolean
representing a current nodelay flag setting.
public void setServicePrincipalName(String name)
DataSource
object.
name
- principal namepublic String getServicePrincipalName()
String
representing current Service Principal Name setting.
public void setConnectionSecurityLevel(int level)
DataSource
object.
level
- security levelpublic int getConnectionSecurityLevel()
int
representing current Connection Security Level setting.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |