public enum JdbcConnectionFactory extends Enum<JdbcConnectionFactory>
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Field and Description |
---|---|
static String |
JDBC_DRIVER |
static String |
JDBC_PASS |
static String |
JDBC_URL |
static String |
JDBC_USER |
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection(String jdbcDriver,
String jdbcUrl,
String jdbcUser,
String jdbcPass)
Get an existing Connection or create and store a new one
|
static JdbcConnectionFactory |
getInstance() |
static JdbcConnectionFactory |
valueOf(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
public static final String JDBC_DRIVER
public static final String JDBC_URL
public static final String JDBC_USER
public static final String JDBC_PASS
public static JdbcConnectionFactory[] values()
for (JdbcConnectionFactory c : JdbcConnectionFactory.values()) System.out.println(c);
public static JdbcConnectionFactory valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static JdbcConnectionFactory getInstance()
public Connection getConnection(String jdbcDriver, String jdbcUrl, String jdbcUser, String jdbcPass) throws SQLException
jdbcDriver
- -jdbcUrl
- -jdbcUser
- -jdbcPass
- -SQLException
- if a JDBC Driver could not be created or registered,
or if a Connection could not be made to the given jdbcUrl
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.