public class JdbcProviderImpl extends java.lang.Object implements JdbcProvider
JdbcProvider interface. The service assumes that JDBC driver JARs are either
added to the Bundle-ClassPath of this bundle, or the necessary packages are added to the Imported-Packages. In the
latter case the class names of the drivers must be listed in the "SMILA-JDBC" manifest header so that they can be
loaded by the service during activation. If the driver JARs are added to the Bundle-ClassPath and are
JDBC-4-compliant, the driver classes should be auto-detected from the contained
META-INF/services/java.sql.Driver files. If this does not work, you can still list the class name in the
"SMILA-JDBC" header for these drivers, too.| Constructor and Description |
|---|
JdbcProviderImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(ComponentContext context)
initialize
DriverManager to auto-detect driver classes from the Bundle-ClassPath, and add driver classes
listed in the SMILA-JDBC manifest header. |
java.sql.Connection |
getConnection(java.lang.String url,
java.util.Properties properties)
create DB connection from url and properties.
|
java.sql.Connection |
getConnection(java.lang.String url,
java.lang.String user,
java.lang.String password)
create DB connection from url, user and password.
|
public java.sql.Connection getConnection(java.lang.String url,
java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
JdbcProvidergetConnection in interface JdbcProviderjava.sql.SQLExceptionpublic java.sql.Connection getConnection(java.lang.String url,
java.util.Properties properties)
throws java.sql.SQLException
JdbcProvidergetConnection in interface JdbcProviderjava.sql.SQLExceptionprotected void activate(ComponentContext context)
DriverManager to auto-detect driver classes from the Bundle-ClassPath, and add driver classes
listed in the SMILA-JDBC manifest header.