| java.lang.Object org.apache.derby.jdbc.ReferenceableDataSource
All known Subclasses: org.apache.derby.jdbc.EmbeddedDataSource,
ReferenceableDataSource | public class ReferenceableDataSource implements javax.naming.Referenceable,java.io.Serializable,ObjectFactory(Code) | | 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:
- databaseName
- dataSourceName
- description
- password
- user
See the specific Cloudscape DataSource implementation for details on their meaning.
See the JDBC 3.0 specification for more details.
|
ReferenceableDataSource | public ReferenceableDataSource()(Code) | | No-arg constructor.
|
getDataSourceName | final public String getDataSourceName()(Code) | | data source name |
getDescription | final public String getDescription()(Code) | | description |
getLogWriter | public PrintWriter getLogWriter() throws SQLException(Code) | | 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 data source object is
created the log writer is initially null, in other words, logging
is disabled.
the log writer for this data source, null if disabled exception: SQLException - if a database-access error occurs. |
getLoginTimeout | public int getLoginTimeout() throws SQLException(Code) | | Gets the maximum time in seconds that this data source can wait
while attempting to connect to a database. A value of zero
means that the timeout is the default system timeout
if there is one; otherwise it means that there is no timeout.
When a data source object is created, the login timeout is
initially zero.
the data source login time limit exception: SQLException - if a database access error occurs. |
getObjectInstance | public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception(Code) | | Re-Create Cloudscape datasource given a reference.
Parameters: obj - The possibly null object containing location or referenceinformation that can be used in creating an object. Parameters: name - The name of this object relative to nameCtx, or null if noname is specified. Parameters: nameCtx - The context relative to which the name parameter isspecified, or null if name is relative to the default initial context. Parameters: environment - The possibly null environment that is used increating the object. One of the Cloudscape datasource object created; null if anobject cannot be created. exception: Exception - if this object factory encountered an exceptionwhile attempting to create an object, and no other object factories areto be tried. |
setDataSourceName | final public void setDataSourceName(String dsn)(Code) | | Set the data source name. The property is not mandatory. It is used
for informational purposes only.
Parameters: dsn - the name of the data source |
setDatabaseName | final public synchronized void setDatabaseName(String databaseName)(Code) | | Set the database name. Setting this property is mandatory. If a
database named wombat at g:/db needs to be accessed, database name
should be set to "g:/db/wombat". The database will be booted if it
is not already running in the system.
Parameters: databaseName - the name of the database |
setDescription | final public void setDescription(String desc)(Code) | | Set the data source descripton. This property is not mandatory.
It is used for informational purposes only.
Parameters: desc - the description of the data source |
setLogWriter | public void setLogWriter(PrintWriter out) throws SQLException(Code) | | 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 data source object is
created the log writer is initially null, in other words, logging
is disabled.
Parameters: out - the new log writer; to disable, set to null exception: SQLException - if a database-access error occurs. |
setLoginTimeout | public void setLoginTimeout(int seconds) throws SQLException(Code) | | 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 data source object is created, the login timeout is
initially zero.
Cloudscape ignores this property.
Parameters: seconds - the data source login time limit exception: SQLException - if a database access error occurs. |
setPassword | final public void setPassword(String password)(Code) | | Set the password property for the data source.
This is user's password for any data source getConnection() call
that takes no arguments.
|
setUser | final public void setUser(String user)(Code) | | Set the user property for the data source.
This is user name for any data source getConnection() call
that takes no arguments.
|
|
|