📄 diprocedureinfo.java
字号:
//ARRAY try { c = nameSpace.classForName("org.hsqldb.jdbc.jdbcArray"); typeMap.put(c, ValuePool.getInt(Types.ARRAY)); } catch (Exception e) {} // BIGINT type = ValuePool.getInt(Types.BIGINT); typeMap.put(Long.TYPE, type); typeMap.put(Long.class, type); // BOOLEAN type = ValuePool.getInt(Types.BOOLEAN); typeMap.put(Boolean.TYPE, type); typeMap.put(Boolean.class, type); // BLOB type = ValuePool.getInt(Types.BLOB); try { c = nameSpace.classForName("org.hsqldb.jdbc.jdbcBlob"); typeMap.put(c, type); } catch (Exception e) {} // CHAR type = ValuePool.getInt(Types.CHAR); typeMap.put(Character.TYPE, type); typeMap.put(Character.class, type); typeMap.put(Character[].class, type); typeMap.put(char[].class, type); // CLOB type = ValuePool.getInt(Types.CLOB); try { c = nameSpace.classForName("org.hsqldb.jdbc.jdbcClob"); typeMap.put(c, type); } catch (Exception e) {} // DATALINK type = ValuePool.getInt(Types.DATALINK); typeMap.put(java.net.URL.class, type); // DATE type = ValuePool.getInt(Types.DATE); typeMap.put(java.util.Date.class, type); typeMap.put(java.sql.Date.class, type); // DECIMAL type = ValuePool.getInt(Types.DECIMAL); try { c = nameSpace.classForName("java.math.BigDecimal"); typeMap.put(c, type); } catch (Exception e) {} // DISTINCT try { c = nameSpace.classForName("org.hsqldb.jdbc.jdbcDistinct"); typeMap.put(c, ValuePool.getInt(Types.DISTINCT)); } catch (Exception e) {} // DOUBLE type = ValuePool.getInt(Types.DOUBLE); typeMap.put(Double.TYPE, type); typeMap.put(Double.class, type); // FLOAT : Not actually a legal IN parameter type yet type = ValuePool.getInt(Types.FLOAT); typeMap.put(Float.TYPE, type); typeMap.put(Float.class, type); // INTEGER type = ValuePool.getInt(Types.INTEGER); typeMap.put(Integer.TYPE, type); typeMap.put(Integer.class, type); // JAVA_OBJECT type = ValuePool.getInt(Types.JAVA_OBJECT); typeMap.put(Object.class, type); // LONGVARBINARY type = ValuePool.getInt(Types.LONGVARBINARY); typeMap.put(byte[].class, type); typeMap.put(Binary.class, type); // LONGVARCHAR type = ValuePool.getInt(Types.LONGVARCHAR); typeMap.put(String.class, type); // NULL type = ValuePool.getInt(Types.NULL); typeMap.put(Void.TYPE, type); typeMap.put(Void.class, type); // REF type = ValuePool.getInt(Types.REF); try { c = nameSpace.classForName("org.hsqldb.jdbc.jdbcRef"); typeMap.put(c, type); } catch (Exception e) {} // SMALLINT : Not actually a legal IN parameter type yet type = ValuePool.getInt(Types.SMALLINT); typeMap.put(Short.TYPE, type); typeMap.put(Short.class, type); // STRUCT : type = ValuePool.getInt(Types.STRUCT); try { c = nameSpace.classForName("org.hsqldb.jdbc.jdbcStruct"); typeMap.put(c, type); } catch (Exception e) {} // TIME type = ValuePool.getInt(Types.TIME); typeMap.put(java.sql.Time.class, type); // TIMESTAMP type = ValuePool.getInt(Types.TIMESTAMP); typeMap.put(java.sql.Timestamp.class, type); // TINYINT : Not actually a legal IN parameter type yet type = ValuePool.getInt(Types.TINYINT); typeMap.put(Byte.TYPE, type); typeMap.put(Byte.class, type); // XML : Not actually a legal IN parameter type yet type = ValuePool.getInt(Types.XML); try { c = nameSpace.classForName("org.w3c.dom.Document"); typeMap.put(c, type); c = nameSpace.classForName("org.w3c.dom.DocumentFragment"); typeMap.put(c, type); } catch (Exception e) {} } private void resolveCols() { Class rType; Class[] pTypes; Class clazz; int ptlen; int pclen; boolean isFPCON; rType = method.getReturnType(); pTypes = method.getParameterTypes(); ptlen = pTypes.length; isFPCON = ptlen > 0 && pTypes[0].getName().equals(conClsName); pclen = 1 + ptlen - (isFPCON ? 1 : 0); colClasses = new Class[pclen]; colTypes = new int[pclen]; colClasses[0] = rType; colTypes[0] = typeForClass(rType); for (int i = isFPCON ? 1 : 0, idx = 1; i < ptlen; i++, idx++) { clazz = pTypes[i]; colClasses[idx] = clazz; colTypes[idx] = typeForClass(clazz); } colOffset = rType == Void.TYPE ? 1 : 0; colCount = pclen - colOffset; } /** * This requires the following properties files: * * org_hsqldb_Library.properties * java_math.properties */ void setMethod(Method m) { String remarkKey; method = m; clazz = method.getDeclaringClass(); fqn = null; specificName = null; sig = null; colsResolved = false; remarkKey = clazz.getName().replace('.', '_'); hnd_remarks = BundleHandler.getBundleHandle(remarkKey, null); } int typeForClass(Class c) { Class to; Integer type = (Integer) typeMap.get(c); if (type != null) { return type.intValue(); } // ARRAY (dimension 1) // HSQLDB does not yet support ARRAY for SQL, but // Trigger.fire takes Object[] row, which we report. // Also, it's just friendly to show what "would" // be required if/when we support ARRAY in a broader // sense if (c.isArray() &&!c.getComponentType().isArray()) { return Types.ARRAY; } try { to = Class.forName("java.sql.Array"); if (to.isAssignableFrom(c)) { return Types.ARRAY; } } catch (Exception e) {} // NUMERIC // All java.lang.Number impls and BigDecimal have // already been covered by lookup in typeMap. // They are all final, so this is OK. if (Number.class.isAssignableFrom(c)) { return Types.NUMERIC; } // TIMESTAMP try { to = Class.forName("java.sql.Timestamp"); if (to.isAssignableFrom(c)) { return Types.TIMESTAMP; } } catch (Exception e) {} // TIME try { to = Class.forName("java.sql.Time"); if (to.isAssignableFrom(c)) { return Types.TIMESTAMP; } } catch (Exception e) {} // DATE try { to = Class.forName("java.sql.Date"); if (to.isAssignableFrom(c)) { return Types.DATE; } } catch (Exception e) {} // BLOB try { to = Class.forName("java.sql.Blob"); if (to.isAssignableFrom(c)) { return Types.BLOB; } } catch (Exception e) {} // CLOB try { to = Class.forName("java.sql.Clob"); if (to.isAssignableFrom(c)) { return Types.CLOB; } } catch (Exception e) {} // REF try { to = Class.forName("java.sql.Ref"); if (to.isAssignableFrom(c)) { return Types.REF; } } catch (Exception e) {} // STRUCT try { to = Class.forName("java.sql.Struct"); if (to.isAssignableFrom(c)) { return Types.STRUCT; } } catch (Exception e) {} // LONGVARBINARY : org.hsqldb.Binary is not final if (Binary.class.isAssignableFrom(c)) { return Types.LONGVARBINARY; } // LONGVARCHAR : really OTHER at this point try { // @since JDK1.4 to = Class.forName("java.lang.CharSequence"); if (to.isAssignableFrom(c)) { return Types.LONGVARCHAR; } } catch (Exception e) {} // we have no standard mapping for the specified class // at this point...is it even storable? if (Serializable.class.isAssignableFrom(c)) { // Yes: it is storable, as an OTHER. return Types.OTHER; } // It may (in future, say using bean contract) or may not be storable // (by HSQLDB)... // but then it may be possible to pass to an in-process routine, // so be lenient and just return the most generic type. return Types.JAVA_OBJECT; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -