public void addParam(BindParseNode bind, PDatum datum) throws SQLException {
   PDatum bindDatum = params[bind.getIndex()];
   if (bindDatum != null
       && bindDatum.getDataType() != null
       && !datum.getDataType().isCoercibleTo(bindDatum.getDataType())) {
     throw TypeMismatchException.newException(datum.getDataType(), bindDatum.getDataType());
   }
   params[bind.getIndex()] = datum;
 }
 public ColumnExpression(PDatum datum) {
   this.type = datum.getDataType();
   this.isNullable = datum.isNullable();
   this.maxLength = datum.getMaxLength();
   this.scale = datum.getScale();
   this.sortOrder = datum.getSortOrder();
 }
Exemple #3
0
 public static int getFixedByteSize(PDatum e) {
   assert (e.getDataType().isFixedWidth());
   Integer maxLength = e.getMaxLength();
   return maxLength == null ? e.getDataType().getByteSize() : maxLength;
 }
 public RowKeyColumnExpression(PDatum datum, RowKeyValueAccessor accessor, String name) {
   this(datum, accessor, datum.getDataType(), name);
 }
 public RowKeyColumnExpression(PDatum datum, RowKeyValueAccessor accessor) {
   this(datum, accessor, datum.getDataType(), datum.toString());
 }
 @Override
 public String getParameterClassName(int index) throws SQLException {
   PDatum datum = getParam(index);
   PDataType type = datum == null ? null : datum.getDataType();
   return type == null ? null : type.getJavaClassName();
 }