}
private static void bindReader(@NotNull PreparedStatement ps, int index, @NotNull Reader reader) throws SQLException {
// The structure followed bindInputStream, see the comments there.
if (reader instanceof ReaderWithSize) {
ReaderWithSize readerWithSize = (ReaderWithSize) reader;
long size = readerWithSize.getSize();
if (size <= Integer.MAX_VALUE)
ps.setCharacterStream(index, readerWithSize, (int) size);
else
ps.setCharacterStream(index, readerWithSize, size);
} else {