protected void setMaxLength(String newVal, ProcedureParameter parameter) { if (newVal == null || newVal.trim().length() <= 0) { parameter.setMaxLength(-1); } else { try { parameter.setMaxLength(Integer.parseInt(newVal)); } catch (NumberFormatException ex) { JOptionPane.showMessageDialog( null, "Invalid Max Length (" + newVal + "), only numbers are allowed", "Invalid Maximum Length", JOptionPane.ERROR_MESSAGE); } } }
private void processStartProcedureParameter(Attributes attributes) throws SAXException { String name = attributes.getValue("", "name"); if (name == null) { throw new SAXException("MapLoader::processStartProcedureParameter()," + " no procedure parameter name."); } ProcedureParameter parameter = new ProcedureParameter(name); String type = attributes.getValue("", "type"); if (type != null) { parameter.setType(TypesMapping.getSqlTypeByName(type)); } String length = attributes.getValue("", "length"); if (length != null) { parameter.setMaxLength(Integer.parseInt(length)); } String precision = attributes.getValue("", "precision"); if (precision != null) { parameter.setPrecision(Integer.parseInt(precision)); } String direction = attributes.getValue("", "direction"); if ("in".equals(direction)) { parameter.setDirection(ProcedureParameter.IN_PARAMETER); } else if ("out".equals(direction)) { parameter.setDirection(ProcedureParameter.OUT_PARAMETER); } else if ("in_out".equals(direction)) { parameter.setDirection(ProcedureParameter.IN_OUT_PARAMETER); } procedure.addCallParameter(parameter); }
parameter.setMaxLength(Integer.parseInt(length));
column.setMaxLength(rs.getInt("LENGTH")); column.setPrecision(decimalDigits); column.setProcedure(procedure);
column.setMaxLength(columnSize); column.setPrecision(decimalDigits); column.setProcedure(procedure);