表名:V_WJW_IPT_ADMISSIONNOTE
表结构:
由于项目测试需要,需要将表[V_WJW_IPT_ADMISSIONNOTE]中的字段jilunr进行批量修改,编写测试代码如下:
@Test
public void update_jilunr() throws ClassNotFoundException, SQLException, IOException {
Connection conn = getConnection(ResourceBundle.getBundle("jdbc/jdbc"));
String xml = FileUtils.readFileToString(new File("target/1.xml"), "GBK");
String sql = "UPDATE V_WJW_IPT_ADMISSIONNOTE SET jilunr=? ";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, xml);
ps.executeUpdate();
ps.close();
conn.close();
}
执行后报错,如下:
java.sql.SQLException: 违反协议: [12]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:464)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3665)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1352)
at demo.oracle.UpdateDemo.update_jilunr(UpdateDemo.java:49)
...
折腾了半天,仍不知问题在哪,无意间我修改了SQL语句,如下:
String sql = "UPDATE V_WJW_IPT_ADMISSIONNOTE SET jilunr=? WHERE JZLSH='ZY240889'";
再次执行,则修改通过!
o(︶︿︶)o 唉,看来[LONG]型大字段字段的修改是不能批量修改啊!
- 大小: 6.2 KB
分享到:
相关推荐
java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK ……
NULL 博文链接:https://listen-raining.iteye.com/blog/1962065
NULL 博文链接:https://zhang-zling.iteye.com/blog/980488
服务器出现java.sql.SQLException No suitable driver found for 的
在oracle里面运行一下,解决Exception java.sql.SQLException ORA-00600 内部错误代码
oracle ora-各种常见java.sql.SQLException归纳
本文主要介绍了关于MySQL存储表情报错:java.sql.SQLException: Incorrect string value: ‘\xF0\x9F\x92\xA9\x0D\x0A…’的相关解决方法,分享出供大家参考学习,下面话不多说了,来一起看看详细的介绍: ...
Q: I am working with ... I am using updateBinaryStream method of resultset to update the BLOB field but it is failing after giving following exception java.sql.SQLException: Internal Error: Unable to
java.sql.SQLException: null, message from server: “Host ‘223.72.41.7’ is not allowed to connect to this MySQL server” 客户端访问时报错: 解决方法: 1,登陆服务器 mysql> use mysql; //用mysql ...
mysql5.6连接驱动jaf,可处理报错java.sql.SQLException: No suitable driver
主要给大家介绍了关于MySQL存储表情时报错:java.sql.SQLException: Incorrect string value: 'xF0x9Fx92xA9x0Dx0A...'的解决方法,文中通过示例代码介绍的非常详细,需要的朋友可以参考借鉴,下面来一起看看吧。
java.sql.SQLException: Operation not allowed after ResultSet closed java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in
异常错误:java.sql.SQLException: The server time zone value ‘?й???’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTime...
oracle 10g 数据库驱动下载:oracle jdbc dirver
问题是这样的…我在VS2008直接运行打开网页,可以连接... 异常详细信息: System.Data.SqlClient.SqlException: 无法打开登录所请求的数据库 “TakeClass”。登录失败。 用户 ‘2D2727E2578F446\ASPNET’ 登录失败。
该用户与可信 SQL Server 连接无关联。 说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.SqlClient....
绝对好用的9i驱动包+10g驱动包 解决java.sql.SQLException: 不支持的特性 解决oracle.jdbc.driver.OracleDatabaseMetaData.supportsGetGeneratedKeys()Z异常 等等
Caused by: java.sql.SQLException: java.lang.ClassNotFoundException: org.apache.hive.jdbc.HiveDriver at com.trs.gateway.commons.hive.HiveFeature.getConnection(HiveFeature.java:57) at ...
import java.sql.SQLException; import java.sql.Statement; import java.sql.ResultSet; /** * @author Administrator * */ public class sqlServer { String DBDriver=...