public class UcanaccessDataSource extends Object implements Serializable, Referenceable, DataSource
Constructor and Description |
---|
UcanaccessDataSource() |
Modifier and Type | Method and Description |
---|---|
String |
getAccessPath()
See
setAccessPath(String) for details. |
String |
getColumnOrder()
See
setColumnOrder(String) for details. |
Boolean |
getConcatNulls()
See
setConcatNulls(Boolean) for details. |
Connection |
getConnection()
Opens the connection to the Access database.
|
Connection |
getConnection(String _username,
String _password)
Opens the connection to the Access database using the provided username and password.
|
Boolean |
getEncrypt()
See
setEncrypt(Boolean) for details. |
Boolean |
getIgnoreCase()
See
setIgnoreCase(Boolean) for details. |
Boolean |
getImmediatelyReleaseResources()
See
setImmediatelyReleaseResources(Boolean) for details. |
Integer |
getInactivityTimeout()
See
setInactivityTimeout(Integer) for details. |
String |
getJackcessOpener()
See
setJackcessOpener(String) for details. |
String |
getKeepMirror()
See
setKeepMirror(String) for details. |
Integer |
getLobScale()
See
setLobScale(Integer) for details. |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Boolean |
getMemory()
See
setMemory(Boolean) for details. |
String |
getMirrorFolder()
See
setMirrorFolder(String) for details. |
String |
getNewDatabaseVersion()
See
setNewDatabaseVersion(String) for details. |
Boolean |
getOpenExclusive()
See
setOpenExclusive(Boolean) for details. |
Logger |
getParentLogger() |
Boolean |
getPreventReloading()
See
setPreventReloading(Boolean) for details. |
Reference |
getReference() |
String |
getReMap()
See
setReMap(String) for details. |
Boolean |
getShowSchema()
See
setShowSchema(Boolean) for details. |
Boolean |
getSkipIndexes()
See
setSkipIndexes(Boolean) for details. |
Boolean |
getSysSchema()
See
setSysSchema(Boolean) for details. |
String |
getUser() |
boolean |
isWrapperFor(Class<?> iface) |
void |
setAccessPath(String _accessPath)
Specifies the path to the Access database file.
|
void |
setColumnOrder(String value)
Controls the order in which columns are returned by operations like SELECT *.
|
void |
setConcatNulls(Boolean value)
Controls what is returned by concatenations involving null values.
|
void |
setEncrypt(Boolean value)
Encrypts the backing database.
|
void |
setIgnoreCase(Boolean value)
Enables case-insensitive string comparisons.
|
void |
setImmediatelyReleaseResources(Boolean value)
Releases the Access database and shuts down HSQLDB immediately after the Connection is closed.
|
void |
setInactivityTimeout(Integer value)
For an in-memory backing database (memory=true), this parameter controls the time (in minutes, default=2), that
HSQLDB remains active and the in-memory database remains available after the last connection is closed.
|
void |
setJackcessOpener(String value)
Specifies the name of the custom class to be used by Jackcess when opening the Access database.
|
void |
setKeepMirror(String value)
Specifies the path where a persistent copy of the HSQLDB backing database files should be stored.
|
void |
setLobScale(Integer value)
Controls the allocation unit size for "OLE Object" (i.e., BLOB) data in the HSQLDB backing database.
|
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter _logWriter) |
void |
setMemory(Boolean value)
Controls whether the HSQLDB backing database is created in memory (the default) or on disk.
|
void |
setMirrorFolder(String value)
Specifies the path where the temporary HSQLDB backing database files should be stored.
|
void |
setNewDatabaseVersion(String value)
Creates a new, empty Access database in this format if the database specified by
setAccessPath(String)
does not exist. |
void |
setOpenExclusive(Boolean value)
Opens the Access database in "exclusive" mode.
|
void |
setPassword(String _password) |
void |
setPreventReloading(Boolean value)
Prevents unnecessary re-loading of backing database under very specific circumstances.
|
void |
setReMap(String value)
For this connection, temporarily re-directs linked tables in the Access database to point to a different Access
database.
|
void |
setShowSchema(Boolean value)
Exposes the HSQLDB catalog and schema names (e.g., "PUBLIC") in DatabaseMetadata.
|
void |
setSkipIndexes(Boolean value)
Reduces memory consumption by not creating simple indexes in the backing database.
|
void |
setSysSchema(Boolean value)
Exposes the Access system tables in a read-only schema named "SYS".
|
void |
setUser(String _user) |
<T> T |
unwrap(Class<T> _iface) |
public String getAccessPath()
setAccessPath(String)
for details.public String getColumnOrder()
setColumnOrder(String)
for details.public Boolean getConcatNulls()
setConcatNulls(Boolean)
for details.public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String _username, String _password) throws SQLException
getConnection
in interface DataSource
_username
- _password
- SQLException
public Boolean getEncrypt()
setEncrypt(Boolean)
for details.public Boolean getIgnoreCase()
setIgnoreCase(Boolean)
for details.public Boolean getImmediatelyReleaseResources()
setImmediatelyReleaseResources(Boolean)
for details.public Integer getInactivityTimeout()
setInactivityTimeout(Integer)
for details.public String getJackcessOpener()
setJackcessOpener(String)
for details.public String getKeepMirror()
setKeepMirror(String)
for details.public Integer getLobScale()
setLobScale(Integer)
for details.public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public Boolean getMemory()
setMemory(Boolean)
for details.public String getMirrorFolder()
setMirrorFolder(String)
for details.public String getNewDatabaseVersion()
setNewDatabaseVersion(String)
for details.public Boolean getOpenExclusive()
setOpenExclusive(Boolean)
for details.public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
public Boolean getPreventReloading()
setPreventReloading(Boolean)
for details.public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
public String getReMap()
setReMap(String)
for details.public Boolean getShowSchema()
setShowSchema(Boolean)
for details.public Boolean getSkipIndexes()
setSkipIndexes(Boolean)
for details.public Boolean getSysSchema()
setSysSchema(Boolean)
for details.public String getUser()
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public void setAccessPath(String _accessPath)
For example: C:/folder/database.accdb
_accessPath
- public void setColumnOrder(String value)
value
- Valid values for this parameter are: "DATA", or "DISPLAY".public void setConcatNulls(Boolean value)
value
- public void setEncrypt(Boolean value)
value
- Setting this value to true tells UCanAccess to encrypt the HSQLDB backing database.public void setIgnoreCase(Boolean value)
value
- (default = true)public void setImmediatelyReleaseResources(Boolean value)
value
- Setting this value to true tells UCanAccess to close the Access database file, shut down
HSQLDB, and release all related resources (e.g., memory or disk space) as soon as the Connection is
closed. Otherwise, UCanAccess will "hold on" to those resources for the
setInactivityTimeout(Integer)
in case the Access database gets re-opened.public void setInactivityTimeout(Integer value)
value
- (in minutes)public void setJackcessOpener(String value)
value
- public void setKeepMirror(String value)
value
- public void setLobScale(Integer value)
value
- Values allowed are 1, 2, 4, 8, 16, or 32 (the unit is kB). Default is 2 if memory=true, and 32 (the
HSQLDB default) otherwise.public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
public void setLogWriter(PrintWriter _logWriter) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public void setMemory(Boolean value)
value
- Create the backing database in memory (value=true, the default) or on disk (value=false). Creating the
backing database on disk will be slower, but it can greatly reduce JVM memory usage.public void setMirrorFolder(String value)
setKeepMirror(String)
instead. See the UCanAccess
website for details.value
- public void setNewDatabaseVersion(String value)
setAccessPath(String)
does not exist.value
- Valid values for this parameter are: "V2000", "V2003", "V2007", "V2010", or "V2016".public void setOpenExclusive(Boolean value)
value
- Setting this value to true tells UCanAccess to open the Access database as "exclusive"
(preventing other processes from opening it at the same time).public void setPassword(String _password)
public void setPreventReloading(Boolean value)
value
- Setting this value to true prevents UCanAccess from unnecessarily re-loading the backing
database under very specific circumstances.public void setReMap(String value)
value
- public void setShowSchema(Boolean value)
value
- (default = false)public void setSkipIndexes(Boolean value)
value
- Setting this value to true tells UCanAccess to skip the creation of simple indexes (not
associated with a constraint). It doesn't have an effect on referential integrity constraints (i.e.,
Index Unique, Foreign Key or Primary Key).public void setSysSchema(Boolean value)
value
- (default = false)public void setUser(String _user)
public <T> T unwrap(Class<T> _iface) throws SQLException
unwrap
in interface Wrapper
SQLException
Copyright © 2012–2018 UCanAccess. All rights reserved.