|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.jdbc.ReferenceableDataSource
Cloudscape DataSource implementation base class. ReferenceableDataSource provides support for JDBC standard DataSource attributes and acts as the ObjectFactory to generate Cloudscape DataSource implementations.
The standard attributes provided by this class are:
Field Summary | |
private static java.lang.Class[] |
BOOLEAN_ARG
|
private java.lang.String |
databaseName
|
private java.lang.String |
dataSourceName
|
private java.lang.String |
description
|
private static java.lang.Class[] |
INT_ARG
|
private int |
loginTimeout
|
private java.lang.String |
password
|
private java.io.PrintWriter |
printer
instance variables that will not be serialized |
private static long |
serialVersionUID
|
private static java.lang.Class[] |
STRING_ARG
|
private java.lang.String |
user
|
Constructor Summary | |
ReferenceableDataSource()
No-arg constructor. |
Method Summary | |
(package private) java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password,
boolean requestPassword)
Return a connection for the Cloudscape family of data source implementations. |
java.lang.String |
getDatabaseName()
|
java.lang.String |
getDataSourceName()
|
java.lang.String |
getDescription()
|
int |
getLoginTimeout()
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. |
java.lang.Object |
getObjectInstance(java.lang.Object obj,
javax.naming.Name name,
javax.naming.Context nameCtx,
java.util.Hashtable environment)
Re-Create Cloudscape datasource given a reference. |
java.lang.String |
getPassword()
|
javax.naming.Reference |
getReference()
Referenceable method. |
java.lang.String |
getUser()
|
void |
setDatabaseName(java.lang.String databaseName)
Set the database name. |
void |
setDataSourceName(java.lang.String dsn)
Set the data source name. |
void |
setDescription(java.lang.String desc)
Set the data source descripton. |
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(java.io.PrintWriter out)
Set the log writer for this data source. |
void |
setPassword(java.lang.String password)
Set the password property for the data source.
|
void |
setUser(java.lang.String user)
Set the user property for the data source.
|
(package private) void |
update()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
private static final java.lang.Class[] STRING_ARG
private static final java.lang.Class[] INT_ARG
private static final java.lang.Class[] BOOLEAN_ARG
private java.lang.String description
private java.lang.String dataSourceName
private java.lang.String databaseName
private java.lang.String password
private java.lang.String user
private int loginTimeout
private transient java.io.PrintWriter printer
Constructor Detail |
public ReferenceableDataSource()
Method Detail |
public final void setDatabaseName(java.lang.String databaseName)
databaseName
- the name of the databasepublic java.lang.String getDatabaseName()
public final void setDataSourceName(java.lang.String dsn)
dsn
- the name of the data sourcepublic final java.lang.String getDataSourceName()
public final void setDescription(java.lang.String desc)
desc
- the description of the data sourcepublic final java.lang.String getDescription()
public final void setUser(java.lang.String user)
user
property for the data source.
This is user name for any data source getConnection() call
that takes no arguments.
public final java.lang.String getUser()
public final void setPassword(java.lang.String password)
password
property for the data source.
This is user's password for any data source getConnection() call
that takes no arguments.
public final java.lang.String getPassword()
public int getLoginTimeout() throws java.sql.SQLException
java.sql.SQLException
- if a database access error occurs.public void setLoginTimeout(int seconds) throws java.sql.SQLException
Cloudscape ignores this property.
seconds
- the data source login time limit
java.sql.SQLException
- if a database access error occurs.public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
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 data source object is created the log writer is initially null, in other words, logging is disabled.
java.sql.SQLException
- if a database-access error occurs.public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
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 data source object is created the log writer is initially null, in other words, logging is disabled.
out
- the new log writer; to disable, set to null
java.sql.SQLException
- if a database-access error occurs.public java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable environment) throws java.lang.Exception
getObjectInstance
in interface javax.naming.spi.ObjectFactory
obj
- The possibly null object containing location or reference
information that can be used in creating an object.name
- The name of this object relative to nameCtx, or null if no
name is specified.nameCtx
- The context relative to which the name parameter is
specified, or null if name is relative to the default initial context.environment
- The possibly null environment that is used in
creating the object.
java.lang.Exception
- if this object factory encountered an exception
while attempting to create an object, and no other object factories are
to be tried.public final javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
- cannot find named objectvoid update()
java.sql.Connection getConnection(java.lang.String username, java.lang.String password, boolean requestPassword) throws java.sql.SQLException
java.sql.SQLException
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |