Search in sources :

Example 1 with DatabaseModel

use of net.sourceforge.sqlexplorer.dbstructure.DatabaseModel in project tdq-studio-se by Talend.

the class MetaDataSession method initialise.

/**
 * Initialises the metadata, but only if the meta data has not already been collected
 */
private void initialise() throws SQLException {
    if (getConnection() != null)
        return;
    _assistanceEnabled = SQLExplorerPlugin.getDefault().getPluginPreferences().getBoolean(IConstants.SQL_ASSIST);
    if (_assistanceEnabled) {
        // schedule job to load dictionary for this session
        dictionary = new Dictionary();
        DictionaryLoader dictionaryLoader = new DictionaryLoader(this);
        dictionaryLoader.schedule(500);
    }
    SQLConnection connection = null;
    try {
        connection = grabConnection();
        metaData = connection.getSQLMetaData();
        // MOD gdbu 2011-4-12 bug : 20578
        databaseProductName = metaData.getDatabaseProductName();
        dbModel = new DatabaseModel(this);
        if (metaData.supportsCatalogs())
            catalogs = metaData.getCatalogs();
    } catch (SQLException sqlerror) {
        SQLExplorerPlugin.error(sqlerror);
    // ~20578
    } finally {
        if (connection != null)
            releaseConnection(connection);
    }
}
Also used : Dictionary(net.sourceforge.sqlexplorer.sessiontree.model.utility.Dictionary) DatabaseModel(net.sourceforge.sqlexplorer.dbstructure.DatabaseModel) SQLException(java.sql.SQLException) DictionaryLoader(net.sourceforge.sqlexplorer.sessiontree.model.utility.DictionaryLoader)

Aggregations

SQLException (java.sql.SQLException)1 DatabaseModel (net.sourceforge.sqlexplorer.dbstructure.DatabaseModel)1 Dictionary (net.sourceforge.sqlexplorer.sessiontree.model.utility.Dictionary)1 DictionaryLoader (net.sourceforge.sqlexplorer.sessiontree.model.utility.DictionaryLoader)1