用long字段来处理。参考写法如下:table product_e{
EPRODUCTID varchar2(32);
detail long;
detaillength number(6);
} //写入
sSql = "update product_e set detail = ?,detaillength=? where EPRODUCTID = '"+ sEProductID +"'";
PreparedStatement pre0 = Sqlca.conn.prepareStatement(sSql);
pre0.clearParameters();
byte abyte0[] = (sDetail ).getBytes("GBK");
pre0.setBinaryStream(1, new ByteArrayInputStream(abyte0,0,abyte0.length), abyte0.length);
pre0.setInt(2, abyte0.length);
pre0.executeUpdate();
pre0.close(); //读出
sSql = "select detail,detaillength from product_e where EPRODUCTID = '"+ sEProductID +"'";
rs = Sqlca.getASResultSet(sSql);
if (rs.next()){
sDetail = "";
if(rs.getInt("detaillength")>0)
{
java.io.InputStream inStream = null;
inStream = rs.getBinaryStream("detail");
byte bb[] = new byte[rs.getInt("detaillength")];
int iByte = 0;
while(true)
{
iByte = inStream.read(bb);
if(iByte<=0)
break;
sDetail = sDetail + new String(bb, "GBK");
}
}
}
rs.getStatement().close();
EPRODUCTID varchar2(32);
detail long;
detaillength number(6);
} //写入
sSql = "update product_e set detail = ?,detaillength=? where EPRODUCTID = '"+ sEProductID +"'";
PreparedStatement pre0 = Sqlca.conn.prepareStatement(sSql);
pre0.clearParameters();
byte abyte0[] = (sDetail ).getBytes("GBK");
pre0.setBinaryStream(1, new ByteArrayInputStream(abyte0,0,abyte0.length), abyte0.length);
pre0.setInt(2, abyte0.length);
pre0.executeUpdate();
pre0.close(); //读出
sSql = "select detail,detaillength from product_e where EPRODUCTID = '"+ sEProductID +"'";
rs = Sqlca.getASResultSet(sSql);
if (rs.next()){
sDetail = "";
if(rs.getInt("detaillength")>0)
{
java.io.InputStream inStream = null;
inStream = rs.getBinaryStream("detail");
byte bb[] = new byte[rs.getInt("detaillength")];
int iByte = 0;
while(true)
{
iByte = inStream.read(bb);
if(iByte<=0)
break;
sDetail = sDetail + new String(bb, "GBK");
}
}
}
rs.getStatement().close();
解决方案 »
- 系统架构、数据交换和工作流方向选择更有前景?
- struts2和strut1相比有什么不同?struts2有哪些优点?
- 在JSP中,<select name="select">写,调用数据库调不出来!谢谢!
- 在公司里ajax一般用什么框架?
- 怎样测试记事本的保存功能呢?
- EJB
- 关于<jsp:useBean>有些糊涂谁能帮忙解释一下,谢谢了!
- 求助:struts2的Action中如何得到服务器端指定路径!!!!
- 在flex中怎么访问java servlet的session data?知道的来讲一下,不知道的帮忙up一下,来者有分..
- springmvc和mybatis结合 可以直接把用mybatis写的接口注入到service层????
- 请教:JMS消息中间件,JORAM持久化问题
- 用JAVA在公司里赚点普通生活费,容易吗?
如果超过4000的话,直接clob
你的另外一个帖子问oci配置的已经回复
http://topic.csdn.net/u/20080320/11/cabd6ae7-2c0a-4326-8b01-52260407b4fd.html?seed=1465560473