03-19-2013 01:42 PM
03-20-2013 05:59 AM
03-20-2013 10:55 AM
Map<String, Long> tableCounts = BPMCommandExecutorProxy.execute(new GetTableCountCmd());
public List<String> getTablesPresentInDatabase() {
List<String> tableNames = new ArrayList<String>();
Connection connection = null;
try {
connection = getDbSqlSession().getSqlSession().getConnection();
DatabaseMetaData databaseMetaData = connection.getMetaData();
ResultSet tables = null;
try {
log.debug("retrieving activiti tables from jdbc metadata");
String databaseTablePrefix = getDbSqlSession().getDbSqlSessionFactory().getDatabaseTablePrefix();
String tableNameFilter = databaseTablePrefix+"ACT_%";
if ("postgres".equals(getDbSqlSession().getDbSqlSessionFactory().getDatabaseType())) {
tableNameFilter = databaseTablePrefix+"act_%";
}
if ("oracle".equals(getDbSqlSession().getDbSqlSessionFactory().getDatabaseType())) {
tableNameFilter = databaseTablePrefix+"ACT" + databaseMetaData.getSearchStringEscape() + "_%";
}
tables = databaseMetaData.getTables(null, null, tableNameFilter, getDbSqlSession().JDBC_METADATA_TABLE_TYPES);
while (tables.next()) {
String tableName = tables.getString("TABLE_NAME");
tableName = tableName.toUpperCase();
tableNames.add(tableName);
log.debug(" retrieved activiti table name {}", tableName);
}
} finally {
tables.close();
}
} catch (Exception e) {
throw new ActivitiException("couldn't get activiti table names using metadata: "+e.getMessage(), e);
}
return tableNames;
}
tables = databaseMetaData.getTables(null, null, tableNameFilter, getDbSqlSession().JDBC_METADATA_TABLE_TYPES);
returns just empty iterator, so there is no exception.03-21-2013 07:25 AM
databaseMetaData.getTables(null, null, tableNameFilter, getDbSqlSession().JDBC_METADATA_TABLE_TYPES);
01-06-2015 01:23 AM
01-08-2015 08:31 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.