cs.execute();
assertEquals( "def", cs.getString( 1 ) );
cs.close();
cs = chattyPrepareCall( conn, "call clobIn( ?, ? )" );
cs.setClob( 1, new HarmonySerialClob( "ghi" ) );
cs.registerOutParameter( 2, Types.VARCHAR );
cs.execute();
assertEquals( "ghi", cs.getString( 2 ) );
cs.close();
//
// Clob output parameter
//
ps = chattyPrepare
(
conn,
"create procedure clobOut\n" +
"( out c clob )\n" +
"language java\n" +
"parameter style java\n" +
"no sql\n" +
"external name '" + getClass().getName() + ".clobOut'\n"
);
ps.execute();
ps.close();
cs = chattyPrepareCall( conn, "call clobOut( ? )" );
cs.registerOutParameter( 1, Types.CLOB );
cs.execute();
outVal = cs.getClob( 1 );
assertEquals( "abc", outVal.getSubString( 1L, (int) outVal.length() ) );
cs.close();
//
// Clob inout parameter
//
ps = chattyPrepare
(
conn,
"create procedure clobInOut\n" +
"( inout c clob )\n" +
"language java\n" +
"parameter style java\n" +
"no sql\n" +
"external name '" + getClass().getName() + ".clobInOut'\n"
);
ps.execute();
ps.close();
cs = chattyPrepareCall( conn, "call clobInOut( ? )" );
cs.setClob( 1, new HarmonySerialClob( "ghi" ) );
cs.registerOutParameter( 1, Types.CLOB );
cs.execute();
outVal = cs.getClob( 1 );
assertEquals( "ihg", outVal.getSubString( 1L, (int) outVal.length() ) );