如何在JSP里得到CLOB类型的数据

Aare 2002-02-20 04:40:04
如何在JSP里得到CLOB类型的数据
我试过用getParameter("content");来获得一个
<TEXTAREA>输入值,结果失败,请问该用什么函数呢?
...全文
93 1 收藏 7
写回复
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
skyyoung 2002-02-21
6. LOBS


* To read a piece of a LOB.

BLOB blob = ((OracleResultSet) rset).getBLOB (1);
byte[] bytes = blob.getBytes (<begin index>, <length>);

CLOB clob = ((OracleResultSet) rset).getCLOB (2);
String str = clob.getSubString (<begin index>, <length>);

BFILE bfile = ((OracleResultSet) rset).getBFILE (3);
byte[] bytes = bfile.getBytes (<begin index>, <length>);



* To read the LOB content as a stream.

BLOB blob = ((OracleResultSet) rset).getBLOB (1);
InputStream input_stream = blob.getBinaryStream ();
input_stream.read (...);

CLOB Clob = ((OracleResultSet) rset).getCLOB (1);
Reader char_stream = Clob.getCharacterStream ();
char_stream.read (...);

CLOB Clob = ((OracleResultSet) rset).getCLOB (1);
InputStream input_stream = Clob.getAsciiStream ();
input_stream.read (...);

BFILE bfile = ((OracleResultSet) rset).getBFILE (1);
InputStream input_stream = bfile.getBinaryStream ();
input_stream.read (...);


* To write a specified amount of data into a LOB.

BLOB blob = ((OracleResultSet) rset).getBLOB (1);
byte[] data = ...
int amount_written = blob.putBytes (<begin index>, data);

CLOB clob = ((OracleResultSet) rset).getCLOB (1);
String data = ...
int amount_written = clob.putString (<begin index>, data);


* To replace the LOB content from a stream.

BLOB blob = ((OracleResultSet) rset).getBLOB (1);
OutputStream output_stream = blob.getBinaryOutputStream ();
output_stream.write (...);

CLOB clob = ((OracleResultSet) rset).getCLOB (1);
Writer char_stream = Clob.getCharacterOutputStream ();
char_stream.write (...);

CLOB Clob = ((OracleResultSet) rset).getCLOB (1);
OutputStream output_stream = Clob.getAsciiOutputStream ();
output_stream.write (...);


* To get LOB length.

long length = blob.length ();

long length = clob.length ();

long length = bfile.length ();
回复
skyyoung 2002-02-21
http://www.csdn.net/Expert/TopicView.asp?id=83096&datebasetype=200101
回复
Aare 2002-02-21
JSP 与ORACLE 连接的问题,ORACLE里面的CLOB类型
拜托再想想
回复
Aare 2002-02-21
大虾,JAVA的函数到哪里去找呀?
有没有什么好的参考手册介绍一下?
回复
Aare 2002-02-21
谢谢给了我天书
哎,高手,得到的CLOB数据怎么样POST到服务器上呢,
用request.getParameter("")只能得到英文字母,汉字则显示为乱码
再次感谢
回复
scarab 2002-02-20
如果content是textarea的name就应该没有问题的
回复
bdsc 2002-02-20
java里有clob类型么?
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告