⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 databasemetadata.java

📁 SSD9 练习9
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
     * Is "ALTER TABLE" with drop column supported?     *     * @return true if so     */    public boolean supportsAlterTableWithDropColumn() throws java.sql.SQLException     {        return true;    }    /**     * Is column aliasing supported?     *     * <P>If so, the SQL AS clause can be used to provide names for     * computed columns or to provide alias names for columns as     * required.     *     * A JDBC compliant driver always returns true.     *     * @return true if so     */    public boolean supportsColumnAliasing() throws java.sql.SQLException     {        return true;    }    /**     * Are concatenations between NULL and non-NULL values NULL?     *     * A JDBC compliant driver always returns true.     *     * @return true if so     */    public boolean nullPlusNonNullIsNull() throws java.sql.SQLException     {        return true;  // not sure    }    /**     * Is the CONVERT function between SQL types supported?     *     * @return true if so     */    public boolean supportsConvert() throws java.sql.SQLException     {        return false; // not sure    }    /**     * Is CONVERT between the given SQL types supported?     *     * @param fromType the type to convert from     * @param toType the type to convert to     * @return true if so     * @see Types     */    public boolean supportsConvert(int fromType, int toType)         throws java.sql.SQLException     {        switch (fromType) {            /* The char/binary types can be converted             * to pretty much anything.             */        case java.sql.Types.CHAR:        case java.sql.Types.VARCHAR:        case java.sql.Types.LONGVARCHAR:        case java.sql.Types.BINARY:        case java.sql.Types.VARBINARY:        case java.sql.Types.LONGVARBINARY:            switch (toType) {            case java.sql.Types.DECIMAL:            case java.sql.Types.NUMERIC:            case java.sql.Types.REAL:            case java.sql.Types.TINYINT:            case java.sql.Types.SMALLINT:            case java.sql.Types.INTEGER:            case java.sql.Types.BIGINT:             case java.sql.Types.FLOAT:            case java.sql.Types.DOUBLE:            case java.sql.Types.CHAR:            case java.sql.Types.VARCHAR:            case java.sql.Types.LONGVARCHAR:            case java.sql.Types.BINARY:            case java.sql.Types.VARBINARY:            case java.sql.Types.LONGVARBINARY:            case java.sql.Types.OTHER:            case java.sql.Types.DATE:            case java.sql.Types.TIME:            case java.sql.Types.TIMESTAMP:                return true;            default:                return false;            }                      /* We don't handle the BIT type             * yet.             */        case java.sql.Types.BIT:            return false;            /* The numeric types. Basically they can convert             * among themselves, and with char/binary types.             */                 case java.sql.Types.DECIMAL:        case java.sql.Types.NUMERIC:        case java.sql.Types.REAL:        case java.sql.Types.TINYINT:        case java.sql.Types.SMALLINT:        case java.sql.Types.INTEGER:        case java.sql.Types.BIGINT:        case java.sql.Types.FLOAT:        case java.sql.Types.DOUBLE:            switch (toType) {            case java.sql.Types.DECIMAL:            case java.sql.Types.NUMERIC:            case java.sql.Types.REAL:            case java.sql.Types.TINYINT:            case java.sql.Types.SMALLINT:            case java.sql.Types.INTEGER:            case java.sql.Types.BIGINT:             case java.sql.Types.FLOAT:            case java.sql.Types.DOUBLE:            case java.sql.Types.CHAR:            case java.sql.Types.VARCHAR:            case java.sql.Types.LONGVARCHAR:            case java.sql.Types.BINARY:            case java.sql.Types.VARBINARY:            case java.sql.Types.LONGVARBINARY:                 return true;            default:                return false;            }                      /* MySQL doesn't support a NULL type. */                   case java.sql.Types.NULL:            return false;            /* With this driver, this will always be a serialized             * object, so the char/binary types will work.             */        case java.sql.Types.OTHER:            switch (toType) {            case java.sql.Types.CHAR:            case java.sql.Types.VARCHAR:            case java.sql.Types.LONGVARCHAR:            case java.sql.Types.BINARY:            case java.sql.Types.VARBINARY:            case java.sql.Types.LONGVARBINARY:                return true;            default:                return false;            }                     /* Dates can be converted to char/binary types. */        case java.sql.Types.DATE:            switch (toType) {            case java.sql.Types.CHAR:            case java.sql.Types.VARCHAR:            case java.sql.Types.LONGVARCHAR:            case java.sql.Types.BINARY:            case java.sql.Types.VARBINARY:            case java.sql.Types.LONGVARBINARY:                return true;            default:                return false;            }                      /* Time can be converted to char/binary types */        case java.sql.Types.TIME:            switch (toType) {            case java.sql.Types.CHAR:            case java.sql.Types.VARCHAR:            case java.sql.Types.LONGVARCHAR:            case java.sql.Types.BINARY:            case java.sql.Types.VARBINARY:            case java.sql.Types.LONGVARBINARY:                return true;            default:                return false;            }            /* Timestamp can be converted to char/binary types             * and date/time types (with loss of precision).             */        case java.sql.Types.TIMESTAMP:            switch (toType) {            case java.sql.Types.CHAR:            case java.sql.Types.VARCHAR:            case java.sql.Types.LONGVARCHAR:            case java.sql.Types.BINARY:            case java.sql.Types.VARBINARY:            case java.sql.Types.LONGVARBINARY:            case java.sql.Types.TIME:            case java.sql.Types.DATE:                return true;            default:                return false;            }                    /* We shouldn't get here! */                  default:            return false; // not sure        }    }    /**     * Are table correlation names supported?     *     * A JDBC compliant driver always returns true.     *     * @return true if so     */    public boolean supportsTableCorrelationNames() throws java.sql.SQLException     {        return true; // not sure    }    /**     * If table correlation names are supported, are they restricted     * to be different from the names of the tables?     *     * A JDBC compliant driver always returns true.     *     * @return true if so     */    public boolean supportsDifferentTableCorrelationNames() throws java.sql.SQLException     {        return true; // not sure    }    /**     * Are expressions in "ORDER BY" lists supported?     *     * @return true if so     */    public boolean supportsExpressionsInOrderBy() throws java.sql.SQLException     {        return true;    }    /**     * Can an "ORDER BY" clause use columns not in the SELECT?     *     * @return true if so     */    public boolean supportsOrderByUnrelated() throws java.sql.SQLException     {        return false; // not sure    }    /**     * Is some form of "GROUP BY" clause supported?     *     * @return true if so     */    public boolean supportsGroupBy() throws java.sql.SQLException     {        return true;    }    /**     * Can a "GROUP BY" clause use columns not in the SELECT?     *     * @return true if so     */      public boolean supportsGroupByUnrelated() throws java.sql.SQLException     {        return false; // not sure    }    /**     * Can a "GROUP BY" clause add columns not in the SELECT     * provided it specifies all the columns in the SELECT?     *     * @return true if so     */            public boolean supportsGroupByBeyondSelect() throws java.sql.SQLException     {        return true; // not sure    }    /**     * Is the escape character in "LIKE" clauses supported?     *     * A JDBC compliant driver always returns true.     *     * @return true if so     */    public boolean supportsLikeEscapeClause() throws java.sql.SQLException     {        return true;    }    /**     * Are multiple ResultSets from a single execute supported?     *     * @return true if so     */    public boolean supportsMultipleResultSets() throws java.sql.SQLException     {        return false; // not sure    }      /**     * Can we have multiple transactions open at once (on different     * connections)?     *     * @return true if so     */    public boolean supportsMultipleTransactions() throws java.sql.SQLException     {        return true;    }    /**     * Can columns be defined as non-nullable?     *     * A JDBC compliant driver always returns true.     *     * @return true if so     */    public boolean supportsNonNullableColumns() throws java.sql.SQLException     {        return true;    }    /**     * Is the ODBC Minimum SQL grammar supported?     *     * All JDBC compliant drivers must return true.     *     * @return true if so     */            public boolean supportsMinimumSQLGrammar() throws java.sql.SQLException     {        return true;    }    /**     * Is the ODBC Core SQL grammar supported?     *     * @return true if so     */    public boolean supportsCoreSQLGrammar() throws java.sql.SQLException     {        return true;    }    /**     * Is the ODBC Extended SQL grammar supported?     *     * @return true if so     */        public boolean supportsExtendedSQLGrammar() throws java.sql.SQLException     {        return false; // not sure at all    }    /**     * Is the ANSI92 entry level SQL grammar supported?     *     * All JDBC compliant drivers must return true.     *     * @return true if so     */        public boolean supportsANSI92EntryLevelSQL() throws java.sql.SQLException     {        return true;    }        /**     * Is the ANSI92 intermediate SQL grammar supported?     *     * @return true if so     */        public boolean supportsANSI92IntermediateSQL() throws java.sql.SQLException     {        return false; // not sure    }    /**     * Is the ANSI92 full SQL grammar supported?     *     * @return true if so     */        public boolean supportsANSI92FullSQL() throws java.sql.SQLException     {        return false; // not sure    }        /**     * Is the SQL Integrity Enhancement Facility supported?     *     * @return true if so     */        public boolean supportsIntegrityEnhancementFacility() throws java.sql.SQLException     {        return false; // not sure    }        /**     * Is some form of outer join supported?     *     * @return true if so     */        public boolean supportsOuterJoins() throws java.sql.SQLException     {        return true;    }        /**     * Are full nested outer joins supported?     *     * @return true if so     */        public boolean supportsFullOuterJoins() throws java.sql.SQLException     {        return false; // not sure    }        /**     * Is there limited support for outer joins?  (This will be true     * if supportFullOuterJoins is true.)     *     * @return true if so     */        public boolean supportsLimitedOuterJoins() throws java.sql.SQLException     {        return true;    }        /**     * What's the database vendor's preferred term for "schema"?     *     * @return the vendor term     */        public String getSchemaTerm() throws java.sql.SQLException     {        return "";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -