@Service(value="adminToolDBBrowserService") public class AdminToolDBBrowserServiceImpl extends Object implements AdminToolDBBrowserService
| Constructor and Description |
|---|
AdminToolDBBrowserServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection(Connection c,
ConnectionVars vars)
close the connection and does a rollback if DML is not allowed. furthermore original values for autoCommit and readonly will be set.
|
protected static void |
closeStream(Closeable closeable)
closes a closeable quietly
|
protected String |
getClobString(Clob clobObject,
String encoding)
turns clob into a string
|
Connection |
getConnection(String datasourceName,
ConnectionVars vars)
gets a connection from datasource and sets autoCommit to false and readonly to true if DML is not allowed
|
List<String> |
getDatasourceNames() |
Map<String,DataSource> |
getDatasources()
returns the configured data sources
could be used to add data sources manually |
Map<String,List<ExampleStatement>> |
getExamplesForDatasource(StatementTO statementTO)
returns the clusters of examples for vendor. if statementTO is null first data source will be used.
|
QueryResultTO |
getMetadata(String datasourceName) |
String |
getTab(StatementTO statementTO,
String id) |
protected boolean |
isDMLAllowed() |
protected void |
iterateResult(ResultSet resSet,
QueryResultTO resultTO,
StatementTO statementTO)
iterates the resultSet and fills resultTO
|
protected static String |
printException(Throwable throwable)
prints a exception into a string
|
QueryResultTO |
queryDatabase(StatementTO statementTO)
queries database with specified statementTO and returns the QueryResultTO
|
void |
setDatasources(Map<String,DataSource> datasources)
to override the configured data sources
|
public Map<String,DataSource> getDatasources()
AdminToolDBBrowserServicegetDatasources in interface AdminToolDBBrowserServicepublic void setDatasources(Map<String,DataSource> datasources)
AdminToolDBBrowserServicesetDatasources in interface AdminToolDBBrowserServicedatasourceNames - the datasourceNames to setpublic List<String> getDatasourceNames()
getDatasourceNames in interface AdminToolDBBrowserServiceprotected boolean isDMLAllowed()
public Connection getConnection(String datasourceName, ConnectionVars vars) throws SQLException
AdminToolDBBrowserServicegetConnection in interface AdminToolDBBrowserServiceSQLExceptionpublic void closeConnection(Connection c, ConnectionVars vars)
AdminToolDBBrowserServicecloseConnection in interface AdminToolDBBrowserServicepublic QueryResultTO getMetadata(String datasourceName)
getMetadata in interface AdminToolDBBrowserServicepublic QueryResultTO queryDatabase(StatementTO statementTO)
AdminToolDBBrowserServicequeryDatabase in interface AdminToolDBBrowserServiceprotected void iterateResult(ResultSet resSet, QueryResultTO resultTO, StatementTO statementTO)
resSet - resultTO - statementTO - protected String getClobString(Clob clobObject, String encoding) throws IOException, SQLException, UnsupportedEncodingException
clobObject - encoding - IOExceptionSQLExceptionUnsupportedEncodingExceptionprotected static String printException(Throwable throwable)
throwable - protected static void closeStream(Closeable closeable)
closeable - public String getTab(StatementTO statementTO, String id)
getTab in interface AdminToolDBBrowserServiceid - html id value for elementpublic Map<String,List<ExampleStatement>> getExamplesForDatasource(StatementTO statementTO)
AdminToolDBBrowserServicegetExamplesForDatasource in interface AdminToolDBBrowserServiceCopyright © 2016–2017. All rights reserved.