public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
System.out.println(setter.getPreparedStatement().getClass().toString());
System.out.println("开始判断是否是实例");
if (setter.getPreparedStatement() instanceof OraclePreparedStatement) {
System.out.println("结束实例判断");
OraclePreparedStatement ops = (OraclePreparedStatement) setter.getPreparedStatement();
System.out.println("blw002");
if (parameter == null) {
System.out.println("blw");
ops.setNull(setter.getParameterIndex(),
oracle.jdbc.OracleTypes.OPAQUE, "SYS.XMLTYPE");
} else {
System.out.println(parameter.toString());
XMLType xmlInput = XMLType.createXML(ops.getConnection(),
(Document) parameter);
// Document doc = DocumentHelper.parseText(parameter.toString(), false);
// XMLType xmlInput = XMLType.createXML(ops.getConnection(),doc);
// System.out.println(xmlInput.getStringVal());
ops.setObject(setter.getParameterIndex(), xmlInput);
}
} else {
throw new UnsupportedOperationException(
"XMLType mapping only supported for Oracle RDBMS");
}
}