private static void setMetaData(Connection con) throws SQLException {
        DatabaseMetaData metaData = con.getMetaData();
        // Supports transactions?
        transactionsSupported = metaData.supportsTransactions();
        // Supports subqueries?
        subqueriesSupported = metaData.supportsCorrelatedSubqueries();
        // Supports scroll insensitive result sets? Try/catch block is a
        // workaround for DB2 JDBC driver, which throws an exception on
        // the method call.
        try {
            scrollResultsSupported = metaData.supportsResultSetType(
                    ResultSet.TYPE_SCROLL_INSENSITIVE);
        }
        catch (Exception e) {
            scrollResultsSupported = false;
        }
        // Supports batch updates
        batchUpdatesSupported = metaData.supportsBatchUpdates();

        // Set defaults for other meta properties
        streamTextRequired = false;
        maxRowsSupported = true;
        fetchSizeSupported = true;
        identifierQuoteString = metaData.getIdentifierQuoteString();

        // Get the database name so that we can perform meta data settings.
        String dbName = metaData.getDatabaseProductName().toLowerCase();
        String driverName = metaData.getDriverName().toLowerCase();

        // Oracle properties.
        if (dbName.contains("oracle")) {
            databaseType = DatabaseType.oracle;
            streamTextRequired = true;
            // scrollResultsSupported = false; /* comment and test this, it should be supported since 10g */
            // The i-net AUGURO JDBC driver
            if (driverName.contains("auguro")) {
                streamTextRequired = false;
                fetchSizeSupported = true;
                maxRowsSupported = false;
            }
        }
        // Postgres properties
        else if (dbName.contains("postgres")) {
            databaseType = DatabaseType.postgresql;
            // Postgres blows, so disable scrolling result sets.
            scrollResultsSupported = false;
            fetchSizeSupported = false;
        }
        // Interbase properties
        else if (dbName.contains("interbase")) {
            databaseType = DatabaseType.interbase;
            fetchSizeSupported = false;
            maxRowsSupported = false;
        }
        // SQLServer
        else if (dbName.contains("sql server")) {
            databaseType = DatabaseType.sqlserver;
            // JDBC driver i-net UNA properties
            if (driverName.contains("una")) {
                fetchSizeSupported = true;
                maxRowsSupported = false;
            }
        }
        // MySQL properties
        else if (dbName.contains("mysql") || dbName.contains("maria")) {
            databaseType = DatabaseType.mysql;
            // transactionsSupported = false; /* comment and test this, it should be supported since 5.0 */
        }
        // HSQL properties
        else if (dbName.contains("hsql")) {
            databaseType = DatabaseType.hsqldb;
            // scrollResultsSupported = false; /* comment and test this, it should be supported since 1.7.2 */
        }
        // DB2 properties.
        else if (dbName.contains("db2")) {
            databaseType = DatabaseType.db2;
        }
    }
Uses a connection from the database to set meta data information about
what different JDBC drivers and databases support.

@param con the connection.
@throws SQLException if an SQL exception occurs.
xmppserver/src/main/java/org/jivesoftware/database/DbConnectionManager.java