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

📄 typecompilerfactoryimpl.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
                              getAnInstance(PACKAGE_NAME + "CLOBTypeCompiler",                                            nclobTypeCompiler,                                            typeId);                      }                  case Types.LONGVARCHAR:                          sqlTypeName = typeId.getSQLTypeName();                          if (sqlTypeName.equals(TypeId.LONGVARCHAR_NAME))                          {                                return longvarcharTypeCompiler =                                        getAnInstance(PACKAGE_NAME + "CharTypeCompiler",                                                                longvarcharTypeCompiler,                                                                typeId);                          }                          else                          {                                return nationalLongvarcharTypeCompiler =                                        getAnInstance(PACKAGE_NAME + "CharTypeCompiler",                                                                nationalLongvarcharTypeCompiler,                                                                typeId);                          }                  case Types.REAL:                        return realTypeCompiler =                                getAnInstance(PACKAGE_NAME + "NumericTypeCompiler",                                                                realTypeCompiler,                                                                typeId);                  case Types.SMALLINT:                        return smallintTypeCompiler =                                getAnInstance(PACKAGE_NAME + "NumericTypeCompiler",                                                                smallintTypeCompiler,                                                                typeId);                  case Types.TINYINT:                    return tinyintTypeCompiler =                                getAnInstance(PACKAGE_NAME + "NumericTypeCompiler",                                                                tinyintTypeCompiler,                                                                typeId);                  case Types.DATE:                        return dateTypeCompiler =                                        getAnInstance(PACKAGE_NAME + "DateTypeCompiler",                                                                        dateTypeCompiler,                                                                        typeId);                  case Types.TIME:                        return timeTypeCompiler =                                        getAnInstance(PACKAGE_NAME + "TimeTypeCompiler",                                                                        timeTypeCompiler,                                                                        typeId);                  case Types.TIMESTAMP:                        return timestampTypeCompiler =                                        getAnInstance(PACKAGE_NAME + "TimestampTypeCompiler",                                                                        timestampTypeCompiler,                                                                        typeId);                  case Types.VARBINARY:                        return varbitTypeCompiler =                                getAnInstance(PACKAGE_NAME + "BitTypeCompiler",                                                                varbitTypeCompiler,                                                                typeId);                  case Types.VARCHAR:                          sqlTypeName = typeId.getSQLTypeName();                          if (sqlTypeName.equals(TypeId.VARCHAR_NAME))                          {                                return varcharTypeCompiler =                                        getAnInstance(PACKAGE_NAME + "CharTypeCompiler",                                                                varcharTypeCompiler,                                                                typeId);                          }                          else                          {                                return nationalVarcharTypeCompiler =                                        getAnInstance(PACKAGE_NAME + "CharTypeCompiler",                                                                nationalVarcharTypeCompiler,                                                                typeId);                          }                  case org.apache.derby.iapi.reference.JDBC20Translation.SQL_TYPES_JAVA_OBJECT:                  case Types.OTHER:                        if (typeId.isRefTypeId())                        {                                return refTypeCompiler = getAnInstance(                                                                                        PACKAGE_NAME + "RefTypeCompiler",                                                                                        refTypeCompiler,                                                                                        typeId);                        }                        else                        {                                // Cannot re-use instances of user-defined type compilers,                                // because they contain the class name                                BaseTypeCompiler btc = new UserDefinedTypeCompiler();                                btc.setTypeId(typeId);                                return btc;                        }                  case StoredFormatIds.XML_TYPE_ID:                        return xmlTypeCompiler =                                getAnInstance(PACKAGE_NAME + "XMLTypeCompiler",                                                                xmlTypeCompiler,                                                                typeId);                }                if (SanityManager.DEBUG)                {                        SanityManager.THROWASSERT("Unexpected JDBC type id " +                                                                                typeId.getJDBCTypeId() +                                                                                " for typeId of class " +                                                                                typeId.getClass().getName());                }                return null;        }        /**         * Check whether the given TypeCompiler has been allocated yet.         * If so, just return it, otherwise allocate a new instance         * given its class.         */        private static TypeCompiler getAnInstance(String className,                                                                TypeCompiler anInstance,                                                                TypeId typeId)        {                if (anInstance == null)                {                        Exception exc = null;                        Class typeCompilerClass = null;                        try                        {                                typeCompilerClass = Class.forName(className);                                anInstance  = (TypeCompiler) typeCompilerClass.newInstance();                                ((BaseTypeCompiler) anInstance).setTypeId(typeId);                        }                        catch (ClassNotFoundException cnfe)                        {                                exc = cnfe;                        }                        catch (IllegalAccessException iae)                        {                                exc = iae;                        }                        catch (InstantiationException ie)                        {                                exc = ie;                        }                        if (SanityManager.DEBUG)                        {                                if (exc != null)                                {                                        SanityManager.THROWASSERT(                                                "Exception " +                                                exc +                                                " while trying to get new instance of a " +                                                typeCompilerClass.getName());                                }                        }                }                return anInstance;        }}

⌨️ 快捷键说明

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