public enum JdbcConnectionFactory extends java.lang.Enum<JdbcConnectionFactory>
Modifier and Type | Class and Description |
---|---|
private static class |
JdbcConnectionFactory.DotPlotter |
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.sql.Connection> |
CONNECTIONS |
private static java.lang.String |
CTAKES_HOME |
private static Logger |
DOT_LOGGER |
private static Logger |
EOL_LOGGER |
private static java.lang.String |
HSQL_DB_EXT |
private static java.lang.String |
HSQL_FILE_PREFIX |
private static Logger |
LOGGER |
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection(java.lang.String jdbcDriver,
java.lang.String jdbcUrl,
java.lang.String jdbcUser,
java.lang.String jdbcPass)
Get an existing Connection or create and store a new one
|
private static java.lang.String |
getConnectionUrl(java.lang.String jdbcUrl)
Uses
FileLocator to get the canonical path to the database file |
static JdbcConnectionFactory |
getInstance() |
static JdbcConnectionFactory |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static JdbcConnectionFactory[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JdbcConnectionFactory INSTANCE
private static final java.lang.String CTAKES_HOME
private static final Logger LOGGER
private static final Logger DOT_LOGGER
private static final Logger EOL_LOGGER
private static final java.lang.String HSQL_FILE_PREFIX
private static final java.lang.String HSQL_DB_EXT
private final java.util.Map<java.lang.String,java.sql.Connection> CONNECTIONS
public static JdbcConnectionFactory[] values()
for (JdbcConnectionFactory c : JdbcConnectionFactory.values()) System.out.println(c);
public static JdbcConnectionFactory valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static JdbcConnectionFactory getInstance()
public java.sql.Connection getConnection(java.lang.String jdbcDriver, java.lang.String jdbcUrl, java.lang.String jdbcUser, java.lang.String jdbcPass) throws java.sql.SQLException
jdbcDriver
- -jdbcUrl
- -jdbcUser
- -jdbcPass
- -java.sql.SQLException
- if a JDBC Driver could not be created or registered,
or if a Connection could not be made to the given jdbcUrl
private static java.lang.String getConnectionUrl(java.lang.String jdbcUrl) throws java.sql.SQLException
FileLocator
to get the canonical path to the database filejdbcUrl
- -java.sql.SQLException