public final class AdapterFactory extends Object
Adapter
objects based on specified JDBC driver name.Modifier and Type | Method and Description |
---|---|
static Adapter |
autoDetectAdapter(Connection con)
Creates a new instance of the Torque database adapter based on
the JDBC meta-data
|
static Adapter |
create(String key)
Creates a new instance of the Torque database adapter associated
with the specified JDBC driver or adapter key.
|
static Adapter |
create(String key,
String className)
Creates a new instance of the Torque database adapter associated
with the specified JDBC driver or adapter key and the class defined.
|
static void |
setCapabilities(Connection con,
Adapter adapter)
Update static capabilities of the Torque database adapter with actual
readings based on the JDBC meta-data
|
public static Adapter autoDetectAdapter(Connection con) throws InstantiationException, SQLException
con
- a database connectionInstantiationException
- if the adapter could not be
instantiatedSQLException
- if there are problems getting the JDBC meta datapublic static void setCapabilities(Connection con, Adapter adapter) throws SQLException
con
- a database connectionadapter
- an adapterSQLException
- if there are problems getting the JDBC meta datapublic static Adapter create(String key) throws InstantiationException
key
- The fully-qualified name of the JDBC driver
or a shorter form adapter key.InstantiationException
- throws if the adapter could not be
instantiatedpublic static Adapter create(String key, String className) throws InstantiationException
key
- The fully-qualified name of the JDBC driver
or a shorter form adapter key.className
- The fully qualified name of the adapter classInstantiationException
- throws if the adapter could not be
instantiatedCopyright © 2000–2020 The Apache Software Foundation. All rights reserved.