public class JdbcServiceImpl extends Object implements JdbcService
| Constructor and Description |
|---|
JdbcServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
create(String name,
String driverName,
String driverClass,
String databaseName,
String url,
String user,
String password)
Create a JDBC datasource configuration.
|
List<String> |
datasources()
List the JDBC datasources available.
|
void |
delete(String name)
Delete a JDBC datasource identified by a name.
|
void |
execute(String datasource,
String command)
Execute a SQL command on a given JDBC datasource.
|
List<String> |
factoryNames()
List the JDBC DataSourceFactories available.
|
Map<String,String> |
info(String datasource)
Get detailed info about a JDBC datasource.
|
Map<String,List<String>> |
query(String datasource,
String query)
Execute a SQL query on a given JDBC datasource.
|
void |
setBundleContext(org.osgi.framework.BundleContext bundleContext) |
void |
setConfigAdmin(org.osgi.service.cm.ConfigurationAdmin configAdmin) |
Map<String,List<String>> |
tables(String datasource)
List the tables available on a given JDBC datasource.
|
public void create(String name, String driverName, String driverClass, String databaseName, String url, String user, String password) throws Exception
JdbcServicecreate in interface JdbcServicename - Datasource namedriverName - Backend database type (osgi.jdbc.driver.name of DataSourceFactory)url - JDBC URLuser - Database user namepassword - Database passwordExceptionpublic void delete(String name) throws Exception
JdbcServicedelete in interface JdbcServicename - Datasource nameExceptionpublic List<String> datasources() throws Exception
JdbcServicedatasources in interface JdbcServiceExceptionpublic Map<String,List<String>> query(String datasource, String query) throws Exception
JdbcServicequery in interface JdbcServicedatasource - the JDBC datasource name.query - the SQL query to execute.Exceptionpublic void execute(String datasource, String command) throws Exception
JdbcServiceexecute in interface JdbcServicedatasource - the JDBC datasource name.command - the SQL command to execute.Exceptionpublic Map<String,List<String>> tables(String datasource) throws Exception
JdbcServicetables in interface JdbcServicedatasource - the JDBC datasource name.Exceptionpublic Map<String,String> info(String datasource) throws Exception
JdbcServiceinfo in interface JdbcServicedatasource - the JDBC datasource name.Exceptionpublic List<String> factoryNames() throws Exception
JdbcServicefactoryNames in interface JdbcServiceExceptionpublic void setBundleContext(org.osgi.framework.BundleContext bundleContext)
public void setConfigAdmin(org.osgi.service.cm.ConfigurationAdmin configAdmin)
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.