找不到BinaryOutputStream ,要应用什么包啊? oracle.sql.BLOB你需要一个oracle的数据库驱动。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我把classes111解压倒我的bean存放路径下了我连接oracle都没有问题 你不需要解压,你只需要加到classpath中,你使用的什么服务器。 不是BLOB没有找到,而是BinaryOutputStream没有找到 BinaryOutputStream是哪儿来的啊?为什么se和ee里面都没有的啊? 网上看到一遍文章上的Connection conn = ConnBean.getConnection(); Statement stmt = conn.createStatement();stmt.executeUpdate("insert into excel(id,excel) values('aaa',empty_blob())"); ResultSet rs = stmt.executeQuery("select excel from excel where name='aaa' for upfdate" ); if(rs.next()) { Blob blob = rs.getBlob(1); BinaryOutputStream out = ((oracle.sql.BLOB)blob).getBinaryOutputStream(); byte[] b = new byte[((oracle.sql.BLOB)blob).getBufferSize]; InputStream fin = new FileInputStream(file); int len = 0; while( (len = fin.read(b)) != -1) out.write(b,0,len); fin.close(); out.close(); con.commit(); } BinaryOutputStream是不是改成ByteArrayOutputStream,这个方法在java.io.ByteArrayOutputStream 105576268不过我不经常开,有事你可以用msn来找我,我的号是[email protected] BinaryOutputStream out = ((oracle.sql.BLOB)blob).getBinaryOutputStream(); 改成OutputStream out = ((oracle.sql.BLOB)blob).getBinaryOutputStream();试一试。 jsp新手求教 js 中 |= 的用法???? JSTL里Character类型怎么比较 开发一个内容比较多的门户网站,前端表现用什么框架比较好? 网通开始封宽带路由器 我想要把数据库中,NUM字段值相同的显示在一行上,该怎么设置呢? jsp访问数据库问题 各位帮忙看看!!!!!!!!!!!!!!!! 聊天室信息的显示不用页面的刷新怎么实现实时显示? 关于处理jsp中全角显示的问题。 救急!启动时装载servlet!一定给分 简单的问题,请高手解答
我连接oracle都没有问题
为什么se和ee里面都没有的啊?
Connection conn = ConnBean.getConnection();
Statement stmt = conn.createStatement();stmt.executeUpdate("insert into excel(id,excel) values('aaa',empty_blob())");
ResultSet rs = stmt.executeQuery("select excel from excel where name='aaa' for upfdate" );
if(rs.next())
{
Blob blob = rs.getBlob(1);
BinaryOutputStream out = ((oracle.sql.BLOB)blob).getBinaryOutputStream();
byte[] b = new byte[((oracle.sql.BLOB)blob).getBufferSize];
InputStream fin = new FileInputStream(file);
int len = 0;
while( (len = fin.read(b)) != -1)
out.write(b,0,len);
fin.close();
out.close();
con.commit();
}
改成
OutputStream out = ((oracle.sql.BLOB)blob).getBinaryOutputStream();
试一试。