关于sql server2000 中image字段的操作问题,java语言

JonasB 2003-11-11 01:24:09
我想从表A中message_body(image字段)取出内容,然后放到表B中的body字段(image类型)
操作表A时,使用rs.getBinaryStream("message_body");
操作表B时,ps为PreparedStatement,
ps.setBinaryStream(1, rs.getBinaryStream("message_body"),?);
那么"?"那个位置应该是什么,谢谢。
...全文
32 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
JonasB 2003-11-11
  • 打赏
  • 举报
回复
用什么方法去这个流的长度,谢谢
lynx1111 2003-11-11
  • 打赏
  • 举报
回复
setBinaryStream
public void setBinaryStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream object. The data will be read from the stream as needed until end-of-file is reached.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.


Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the java input stream which contains the binary parameter value
length - the number of bytes in the stream
Throws:
SQLException - if a database access error occurs
----------------------
length - the number of bytes in the stream

34,623

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧