Пример #1
0
 private void registerOutputParameters(CallableStatement cs, ParameterMapping[] mappings)
     throws SQLException {
   for (int i = 0; i < mappings.length; i++) {
     ParameterMapping mapping = ((ParameterMapping) mappings[i]);
     if (mapping.isOutputAllowed()) {
       if (null != mapping.getTypeName() && !mapping.getTypeName().equals("")) { // @added
         cs.registerOutParameter(i + 1, mapping.getJdbcType(), mapping.getTypeName());
       } else {
         if (mapping.getNumericScale() != null
             && (mapping.getJdbcType() == Types.NUMERIC
                 || mapping.getJdbcType() == Types.DECIMAL)) {
           cs.registerOutParameter(
               i + 1, mapping.getJdbcType(), mapping.getNumericScale().intValue());
         } else {
           cs.registerOutParameter(i + 1, mapping.getJdbcType());
         }
       }
     }
   }
 }