Code example for DatabaseMetaData

Methods: getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDriverMajorVersion, getDriverMinorVersion, getDriverName, getDriverVersion, getMaxTableNameLength, getSQLKeywords

0
 
    @Override 
    public void debug(final DebugBuilder debug) {
        try { 
            final DatabaseMetaData metaData = connection.getMetaData();
            debug.appendln("Product", metaData.getDatabaseProductName() + "  " + metaData.getDatabaseProductVersion());
            try { 
                debug.appendln("Product Version", metaData.getDatabaseMajorVersion() + "." + metaData.getDatabaseMinorVersion());
            } catch (final AbstractMethodError ignore) {
            } 
            debug.appendln("Drive", metaData.getDriverName() + "  " + metaData.getDriverVersion());
            debug.appendln("Driver Version", metaData.getDriverMajorVersion() + "." + metaData.getDriverMinorVersion());
            debug.appendln("Keywords", metaData.getSQLKeywords());
            debug.appendln("Date/Time functions", metaData.getTimeDateFunctions());
            debug.appendln("Mixed case identifiers", metaData.supportsMixedCaseIdentifiers());
            debug.appendln("Lower case identifiers", metaData.storesLowerCaseIdentifiers());
            debug.appendln("Lower case quoted", metaData.storesLowerCaseQuotedIdentifiers());
            debug.appendln("Mixed case identifiers", metaData.storesMixedCaseIdentifiers());
            debug.appendln("Mixed case quoted", metaData.storesMixedCaseQuotedIdentifiers());
            debug.appendln("Upper case identifiers", metaData.storesUpperCaseIdentifiers());
            debug.appendln("Upper case quoted", metaData.storesUpperCaseQuotedIdentifiers());
            debug.appendln("Max table name length", metaData.getMaxTableNameLength());
            debug.appendln("Max column name length", metaData.getMaxColumnNameLength());
 
        } catch (final SQLException e) {
            throw new SqlObjectStoreException("Metadata error", e);
        }