case Types.VARCHAR:
case Types.CHAR:
return randomString(r, r.nextInt(precision + 1));
case Types.LONGVARCHAR:
return new StringReaderWithLength(
randomString(r, r.nextInt(32700 + 1)));
case Types.CLOB:
if (precision > 256*1024)
precision = 256*1024;
return new StringReaderWithLength(
randomString(r, r.nextInt(precision)));
case Types.BINARY:
case Types.VARBINARY:
return randomBinary(r, r.nextInt(precision + 1));
case Types.LONGVARBINARY:
return new ReadOnceByteArrayInputStream(
randomBinary(r, r.nextInt(32701)));
case Types.BLOB:
if (precision > 256*1024)
precision = 256*1024;
return new ReadOnceByteArrayInputStream(
randomBinary(r, r.nextInt(precision)));
case JDBC.SQLXML:
// Not random yet, but was blocked by DEBRY-2350
// so just didn't put effort into generating
// a random size XML document.
return new StringReaderWithLength("<a><b>text</b></a>");
}
// fail("unexpected JDBC Type " + jdbcType);