(100分)如何用Java读出Oracle LOng字段类型中的BMP图片 ResultSet rs InputStream fileStream = rs.getBinaryStream("BMP");byte[] buf = InputStreamTobytes(fileStream); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 InputStreamTobytes这个函数是用来做什么的?我出现如下的错误 [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\jw\test\testlong_jsp.java:61: cannot resolve symbol [javac] symbol : method InputStreamTobytes (java.io.InputStream) [javac] location: class org.apache.jsp.testlong_jsp [javac] byte[] buf = InputStreamTobytes(gif_data); [javac] ^ [javac] 1 error <%@ page import="java.sql.*"%><%@ page import="java.lang.*" %><%@ page import="java.io.*" %><%@ page import="com.jspsmart.upload.*" %><%@ page import="DBstep.iDBManager2000.*"%><% //打开数据库 ResultSet result=null; String Sql=null; PreparedStatement prestmt=null; DBstep.iDBManager2000 DbaObj=new DBstep.iDBManager2000(); DbaObj.OpenConnection(); //取得数据库中的数据 Sql="select * from list order by date desc"; result=DbaObj.ExecuteQuery(Sql); result.next(); //将数据库中的数据读到流中 InputStream in =result.getBinaryStream("body"); //设置输出的格式 response.reset(); response.setContentType("image/jpeg"); //循环去出流中的数据 byte[] b = new byte[1024]; int len; while((len=in.read(b)) >0) response.getOutputStream().write(b,0,len); in.close(); %> sorry,InputStreamTobytes是我自己写的一个方法 public static byte[] InputStreamTobytes(InputStream ao_in) throws IOException{ ByteArrayOutputStream lo_Out = new ByteArrayOutputStream(); int li_data = ao_in.read(); while(li_data != -1){ lo_Out.write(li_data); li_data = ao_in.read(); } return lo_Out.toByteArray(); } 想自学java编程,连接数据库不知道oracle用哪个版本,请高手指点 jdbc能否直接建表,还有什么方式可以通过程序来新建数据库的表? 关于form to entity 的一个问题。 JSP页面如何显示㎡ appliction 的应用 JNDI数据库连接池问题 ArrayList和Vector的区别 基礎配置問題.幫幫忙. 我在一个Jbuilder工程里,写了很多的javabeans类,在另一个工程里,我想用它们,怎么配置?? jsp站点的web服务器需要什么都??怎么设置??那里有说明文档没有啊 如何窗口最大化同时窗口不可以移动? Jsp中想得到tomcat文件夹的路径,怎么办?
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\jw\test\testlong_jsp.java:61: cannot resolve symbol
[javac] symbol : method InputStreamTobytes (java.io.InputStream)
[javac] location: class org.apache.jsp.testlong_jsp
[javac] byte[] buf = InputStreamTobytes(gif_data);
[javac] ^
[javac] 1 error
<%@ page import="java.lang.*" %>
<%@ page import="java.io.*" %>
<%@ page import="com.jspsmart.upload.*" %>
<%@ page import="DBstep.iDBManager2000.*"%>
<%
//打开数据库
ResultSet result=null;
String Sql=null;
PreparedStatement prestmt=null;
DBstep.iDBManager2000 DbaObj=new DBstep.iDBManager2000();
DbaObj.OpenConnection();
//取得数据库中的数据
Sql="select * from list order by date desc";
result=DbaObj.ExecuteQuery(Sql);
result.next();
//将数据库中的数据读到流中
InputStream in =result.getBinaryStream("body");
//设置输出的格式
response.reset();
response.setContentType("image/jpeg");
//循环去出流中的数据
byte[] b = new byte[1024];
int len;
while((len=in.read(b)) >0)
response.getOutputStream().write(b,0,len);
in.close();
%>
public static byte[] InputStreamTobytes(InputStream ao_in) throws IOException{
ByteArrayOutputStream lo_Out = new ByteArrayOutputStream();
int li_data = ao_in.read();
while(li_data != -1){
lo_Out.write(li_data);
li_data = ao_in.read();
}
return lo_Out.toByteArray();
}