BasicEmbeddedDataSource40 is similar to EmbeddedDataSource, but does
not support JNDI naming, i.e. it does not implement
javax.naming.Referenceable.
The standard attributes provided are, cf. e.g. table 9.1 in the JDBC 4.2 specification.
See also the JDBC specifications for more details.
EmbeddedDataSource
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | attributesAsPassword
Set password to be a set of connection attributes. |
| protected String | connectionAttributes
Derby specific connection attributes. |
| protected String | createDatabase
Set to "create" if the database should be created. |
| protected String | |
| protected String | |
| protected String | |
| protected transient InternalDriver | driver
Unlike a DataSource, the internal driver is shared by all Derby databases in the same JVM. |
| protected transient String | jdbcurl
Instance variable that will not be serialized. |
| protected int | loginTimeout
Set by |
| private String | |
| private transient PrintWriter | printer
Instance variable that will not be serialized. |
| private static final long | |
| private String | shortDatabaseName
|
| protected String | shutdownDatabase
Set to "shutdown" if the database should be shutdown. |
| private String | user
Set by |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| pack-priv InternalDriver | Returns: The internal driver handleReturn a handle to the internal driver, possibly instantiating it first if it hasn't been booted or if it has been shut down. |
| private static Object | findService(final String factoryInterface, final String serviceName)
Must be private so that user code can't call this entry point. |
| public boolean | Returns: the valueImplements org. attributesAsPassword property, cf.
setAttributesAsPassword.
|
| public Connection | Returns: a Connection to the databaseImplements javax. |
| public Connection | Returns: a Connection to the databasethe database user on whose behalf the Connection is
being made username, String the user's password password)Implements javax. |
| public final Connection | Returns: user connectionthe user name username, String the password password, boolean true if the password came from the
getConnection() call with user and password arguments..Implements org. |
| public String | Returns: the Derby specific connection URL attributes, seesetConnectionAttributes.Implements org. |
| public String | Returns: The string"create" if create is set, or null if notImplements org. |
| public String | Returns: the database name set bysetDatabaseName.Implements org. |
| public String | Returns: data source name as set insetDataSourceName.Implements org. |
| public String | Returns: the description as set insetDescription.Implements org. |
| public int | Returns: the data source login time limitImplements javax. |
| public PrintWriter | Returns: the log writer for this data source, null if disabledImplements javax. |
| private static ModuleFactory | |
| public java. | getParentLogger()
Implements javax. |
| public String | Returns: the password as set insetPassword.Implements org. |
| private String | |
| public String | |
| public String | Returns: the user name as set bysetUser.Implements org. |
| public int | |
| public boolean | Returns: true if this implements the interface or directly or
indirectly wraps an object that doesa class defining an interface interFace)Implements java. interFace is implemented.
|
| public void | setAttributesAsPassword(boolean
Use attributesAsPassword)true to encode password
argument as a set of connection attributes in a connection request.Implements org. attributeAsPassword property to enable passing connection
request attributes in the password argument of
getConnection(String, String).
|
| public void | setConnectionAttributes(String
set to the list of Derby connection attributes
separated by semi-colons. E.g., to specify an encryption
bootPassword of "x8hhk2adf", and set upgrade to true, do the
following:
prop)
ds.setConnectionAttributes("bootPassword=x8hhk2adf;upgrade=true");
See the Derby documentation for complete list.Implements org. |
| public void | setCreateDatabase(String
if set to the string create)"create", this data
source will try to create a new database of databaseName, or
boot the database if one by that name already exists.Implements org. |
| public synchronized void | setDatabaseName(String
the name of the database databaseName)Implements org. |
| public void | setDataSourceName(String
the name of the data source dsn)Implements org. |
| public void | setDescription(String
the description of the data source desc)Implements org. |
| public void | setLoginTimeout(int
the data source login time limit seconds)Implements javax. |
| public void | setLogWriter(PrintWriter
the new log writer; to disable, set to null out)Implements javax. |
| public void | setPassword(String
The password in plain text password)Implements org. password property for the data source.
|
| public void | setShutdownDatabase(String
if set to the string shutdown)"shutdown", this
data source will shutdown the database if it is running.Implements org. databaseName.
|
| protected static ResourceAdapter | Returns: the resource adapterThe data source ds, ResourceAdapter The cached value if any ra, String The user name user, String The password in clear text password, boolean If requestPassword)true, use the supplied user and
password to boot the database if requiredReturn a resource adapter. |
| public void | setUser(String
The user user)Implements org. user property for the data source.
|
| public <T> T | Returns: an object that implements the interfacea class defining an interface iface)Implements java. this if this class implements the specified interface.
|
| protected void |
| attributesAsPassword | back to summary |
|---|---|
| protected boolean attributesAsPassword Set password to be a set of connection attributes. | |
| connectionAttributes | back to summary |
|---|---|
| protected String connectionAttributes Derby specific connection attributes. Set by
| |
| createDatabase | back to summary |
|---|---|
| protected String createDatabase Set to "create" if the database should be created.
See | |
| databaseName | back to summary |
|---|---|
| protected String databaseName | |
| dataSourceName | back to summary |
|---|---|
| protected String dataSourceName | |
| description | back to summary |
|---|---|
| protected String description Set by | |
| driver | back to summary |
|---|---|
| protected transient InternalDriver driver Unlike a DataSource, the internal driver is shared by all Derby databases in the same JVM. | |
| jdbcurl | back to summary |
|---|---|
| protected transient String jdbcurl Instance variable that will not be serialized. | |
| loginTimeout | back to summary |
|---|---|
| protected int loginTimeout Set by | |
| password | back to summary |
|---|---|
| private String password Set by | |
| printer | back to summary |
|---|---|
| private transient PrintWriter printer Instance variable that will not be serialized. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| shortDatabaseName | back to summary |
|---|---|
| private String shortDatabaseName
| |
| shutdownDatabase | back to summary |
|---|---|
| protected String shutdownDatabase Set to "shutdown" if the database should be shutdown. See | |
| user | back to summary |
|---|---|
| private String user Set by | |
| BasicEmbeddedDataSource40 | back to summary |
|---|---|
| public BasicEmbeddedDataSource40() Constructs a basic embedded data source. See the class Javadoc. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| findDriver | back to summary |
|---|---|
| pack-priv InternalDriver findDriver() throws SQLException Return a handle to the internal driver, possibly instantiating it first if it hasn't been booted or if it has been shut down.
| |
| findService | back to summary |
|---|---|
| private static Object findService(final String factoryInterface, final String serviceName) Must be private so that user code can't call this entry point. | |
| getAttributesAsPassword | back to summary |
|---|---|
| public boolean getAttributesAsPassword() Implements org. Return the value of the
| |
| getConnection | back to summary |
|---|---|
| public Connection getConnection() throws SQLException Implements javax. Attempt to establish a database connection.
| |
| getConnection | back to summary |
|---|---|
| public Connection getConnection(String username, String password) throws SQLException Implements javax. Attempt to establish a database connection with the given username and
password. If the
| |
| getConnection | back to summary |
|---|---|
| public final Connection getConnection(String username, String password, boolean requestPassword) throws SQLException Implements org. Get a user connection: minion method.
| |
| getConnectionAttributes | back to summary |
|---|---|
| public String getConnectionAttributes() Implements org.
| |
| getCreateDatabase | back to summary |
|---|---|
| public String getCreateDatabase() Implements org. | |
| getDatabaseName | back to summary |
|---|---|
| public String getDatabaseName() Implements org.
| |
| getDataSourceName | back to summary |
|---|---|
| public String getDataSourceName() Implements org.
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() Implements org.
| |
| getLoginTimeout | back to summary |
|---|---|
| public int getLoginTimeout() throws SQLException Implements javax. 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. See
| |
| getLogWriter | back to summary |
|---|---|
| public PrintWriter getLogWriter() throws SQLException Implements javax. 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
| |
| getMonitor | back to summary |
|---|---|
| private static ModuleFactory getMonitor() Must be private so that user code can't call this entry point. | |
| getParentLogger | back to summary |
|---|---|
| public java. Implements javax. Doc from javax. Return the parent Logger of all the Loggers used by this data source. This should be the Logger farthest from the root Logger that is still an ancestor of all of the Loggers used by this data source. Configuring this Logger will affect all of the log messages generated by the data source. In the worst case, this may be the root Logger.
| |
| getPassword | back to summary |
|---|---|
| public String getPassword() Implements org.
| |
| getShortDatabaseName | back to summary |
|---|---|
| private String getShortDatabaseName() Return database name with ant attributes stripped off. | |
| getShutdownDatabase | back to summary |
|---|---|
| public String getShutdownDatabase() Implements org.
| |
| getUser | back to summary |
|---|---|
| public String getUser() Implements org. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isWrapperFor | back to summary |
|---|---|
| public boolean isWrapperFor(Class<?> interFace) throws SQLException Implements java. Returns false unless
| |
| setAttributesAsPassword | back to summary |
|---|---|
| public void setAttributesAsPassword(boolean attributesAsPassword) Implements org. Set
| |
| setConnectionAttributes | back to summary |
|---|---|
| public void setConnectionAttributes(String prop) Implements org. Set this property to pass in more Derby specific connection URL
attributes.
| |
| setCreateDatabase | back to summary |
|---|---|
| public void setCreateDatabase(String create) Implements org. Set this property to create a new database. If this property
is not set, the database (identified by | |
| setDatabaseName | back to summary |
|---|---|
| public synchronized void setDatabaseName(String databaseName) Implements org. 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. | |
| setDataSourceName | back to summary |
|---|---|
| public void setDataSourceName(String dsn) Implements org. Set the data source name. The property is not mandatory. It is used for informational purposes only. | |
| setDescription | back to summary |
|---|---|
| public void setDescription(String desc) Implements org. Set the data source descripton. This property is not mandatory. It is used for informational purposes only. | |
| setLoginTimeout | back to summary |
|---|---|
| public void setLoginTimeout(int seconds) throws SQLException Implements javax. 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. Derby currently ignores this property.
| |
| setLogWriter | back to summary |
|---|---|
| public void setLogWriter(PrintWriter out) throws SQLException Implements javax. 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
| |
| setPassword | back to summary |
|---|---|
| public void setPassword(String password) Implements org. Set the
This is user's password for any data source | |
| setShutdownDatabase | back to summary |
|---|---|
| public void setShutdownDatabase(String shutdown) Implements org. Set this property if you wish to shutdown the database identified by
| |
| setupResourceAdapter | back to summary |
|---|---|
| protected static ResourceAdapter setupResourceAdapter(EmbeddedXADataSourceInterface ds, ResourceAdapter ra, String user, String password, boolean requestPassword) throws SQLException Return a resource adapter. Use
| |
| setUser | back to summary |
|---|---|
| public void setUser(String user) Implements org. Set the
This is user name for any data source | |
| unwrap | back to summary |
|---|---|
| public <T> T unwrap(Class<T> iface) throws SQLException Implements java. Returns
| |
| update | back to summary |
|---|---|
| protected void update() Update | |