String encoding)
throws DRDAProtocolException ,
SQLException ,
IOException {
PreparedStatement ps = stmt.getPreparedStatement();
EnginePreparedStatement engnps =
( EnginePreparedStatement ) ps;
final EXTDTAReaderInputStream extdtastream =
reader.getEXTDTAReaderInputStream(checkNullability);
// DERBY-3085. Save the stream so it can be drained later
// if not used.
if (streamLOB)
stmt.setStreamedParameter(extdtastream);
final InputStream is =
streamLOB ?
(InputStream) extdtastream :
convertAsByteArrayInputStream( extdtastream );
final InputStreamReader streamReader =
new InputStreamReader( is,
encoding ) ;
engnps.setCharacterStream( i + 1,
streamReader );
}