Home > Database > Mysql Tutorial > body text

Oracle 数据大小超出此类型的最大值:2736

WBOY
Release: 2016-06-07 17:03:07
Original
1282 people have browsed it

在开发中对数据库进行操作时,字段遇到大数据并且该字段为非BLOB,CLOB的类型时,若采用PreparedStatement方法setString方法时会如

一、异常情况:

在开发中对数据库进行操作时,字段遇到大数据并且该字段为非BLOB,CLOB的类型时,若采用PreparedStatement方法setString方法时会如下异常: java.sql.SQLException: 数据大小超出此类型的最大值:2736。

二、分析原因:

驱动程序在把SQL语句发给数据库前,,PreparedStatement对字符串进行预处理并进行了转义替换;

三、解决办法:

1、使用setCharacterStream方法:

stmt.setCharacterStream(1, new InputStreamReader(String内容, String内容.length());

2、使用OCI驱动连接Oracle数据库。

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!