);
ps.execute();
ps.close();
cs = chattyPrepareCall( conn, "call blobIn( ?, ? )" );
cs.setBlob( 1, new HarmonySerialBlob( "ghi".getBytes( UTF8 ) ) );
cs.registerOutParameter( 2, Types.VARCHAR );
cs.execute();
assertEquals( "ghi", cs.getString( 2 ) );
cs.close();
//
// Blob output parameter
//
ps = chattyPrepare
(
conn,
"create procedure blobOut\n" +
"( out c blob )\n" +
"language java\n" +
"parameter style java\n" +
"no sql\n" +
"external name '" + getClass().getName() + ".blobOut'\n"
);
ps.execute();
ps.close();
cs = chattyPrepareCall( conn, "call blobOut( ? )" );
cs.registerOutParameter( 1, Types.BLOB );
cs.execute();
outVal = cs.getBlob( 1 );
assertEquals( "abc", getBlobValue( outVal ) );
cs.close();
//
// Blob inout parameter
//
ps = chattyPrepare
(
conn,
"create procedure blobInOut\n" +
"( inout c blob )\n" +
"language java\n" +
"parameter style java\n" +
"no sql\n" +
"external name '" + getClass().getName() + ".blobInOut'\n"
);
ps.execute();
ps.close();
cs = chattyPrepareCall( conn, "call blobInOut( ? )" );
cs.setBlob( 1, new HarmonySerialBlob( "ghi".getBytes( UTF8 ) ) );
cs.registerOutParameter( 1, Types.BLOB );
cs.execute();
outVal = cs.getBlob( 1 );
assertEquals( "ihg", getBlobValue( outVal ) );