String xmlSt = '<?xml version="1.0" encoding="utf-16"?><form><control><type>SINGLE</type><row><column><level>1</maxoccurs><minlength>1</minlength><maxlength>250</maxlength>';
String query = "insert into daily_diary(xml_val) values('"+ xmlSt + "'");
int result = entityManager.createNativeQuery(query).executeUpdate();
但它抛出如下:
SQL Error: 0, SQLState: null
11:45:04,175 ERROR [JDBCExceptionReporter] The value is not set for the parameter number 1.
当我们传递冗长的字符串值时它会引发错误,否则它会成功插入。需要一种解决方案来utf-8
在 db 中插入冗长的字符串。