@Override
public int doStartTag() throws PageException {
Object ds=getDatasource(pageContext, datasource);
DataSourceManager manager = pageContext.getDataSourceManager();
DatasourceConnection dc=ds instanceof DataSource?
manager.getConnection(pageContext,(DataSource)ds,username,password):
manager.getConnection(pageContext,Caster.toString(ds),username,password);
try {
if(type==TYPE_TABLE_COLUMNS) typeColumns(dc.getConnection().getMetaData());
else if(type==TYPE_DBNAMES) typeDBNames(dc.getConnection().getMetaData());
else if(type==TYPE_FOREIGNKEYS) typeForeignKeys(dc.getConnection().getMetaData());
else if(type==TYPE_INDEX) typeIndex(dc.getConnection().getMetaData());
else if(type==TYPE_PROCEDURES) typeProcedures(dc.getConnection().getMetaData());
else if(type==TYPE_PROCEDURE_COLUMNS)typeProcedureColumns(dc.getConnection().getMetaData());
else if(type==TYPE_TERMS) typeTerms(dc.getConnection().getMetaData());
else if(type==TYPE_TABLES) typeTables(dc.getConnection().getMetaData());
else if(type==TYPE_VERSION) typeVersion(dc.getConnection().getMetaData());
else if(type==TYPE_USERS) typeUsers(dc.getConnection().getMetaData());
}
catch(SQLException sqle) {
throw new DatabaseException(sqle,dc);
}