title: How to map an XML string as an input parameter to a stored procedure via MyBatis?
body: <p>I've been working on sending an XML string as an input parameter to a SQL Server stored procedure, which is called through a MyBatis mapping interface in Java. My mapping is defined like so:</p>
  
  <pre><code>@Update(value = "{ call prcFoo(" +
                  "#{ stringValue, jdbcType=VARCHAR, mode=IN }," +
                  "#{ xmlValue, jdbcType=CLOB, mode=IN } ) }") 
  @Options(statementType = StatementType.CALLABLE)
  Integer sendXML(@Param("stringValue") String stringValue, 
                     @Param("xmlValue") String xmlValue);
  </code></pre>
  
  <p>The mapping returns an integer value, rather than a result set. I'm getting the procedure error condition (a negative integer) when I make a call using this mapping. It appears to be a problem with reading in the XML, because when I call the procedure directly on the database with the same XML string, it returns the expected value. Am I using MyBatis incorrectly, or is something else wrong?</p>