查查jdk,应该有createImage(byte[])
解决方案 »
- 重构,该不该大刀阔斧
- Spring MVC配置IOC 空指针的问题,围观啊,求解啊~!
- JAVA开发二维码问题
- 关于备份数据库的问题,是否只能在数据库服务器上面备份?
- sping配置详解!!!
- Hibernate中的Session
- 跪求hibernate synchronizer插件
- 服务器端用java的serversocket,客户端用VC写的csocket,它们之间能正常接发数据吗?
- 请问struts里怎么写radio,text,checkbox,谢谢
- 在tomcat下建立了一个虚拟目录,系统怎么不认识,请指教?
- 在Tomcat/Weblogic中要显示的doc文件怎么是乱码?ppt文件也是乱码?怎么不能调用Word和PowerPoint呢?
- 用eclipse和jboss开发ejb的小问题?
Statement stmt=null;
ResultSet set=null;
try{
String cust_id=request.getParameter("CUST_ID2");
String med_num=request.getParameter("MED_NUM2");
String sql="SELECT MED FROM CUST_MED WHERE CUST_ID ='"+cust_id+"';
conn = OurConn.getConnection();
stmt = conn.createStatement();
set = stmt.executeQuery(sql);
if(set.next()){
InputStream in = set.getBinaryStream("MED");
response.reset();
response.setContentType("image/jpeg");
byte[] b = new byte[1024];
int a=0;
int len;
while((len=in.read(b))!=-1){
response.getOutputStream().write(b);
a=1;
}
in.close();
if(a==0)
{ }
}
}catch(Exception e){
}finally{
try{
if(set!=null)
set.close();
}catch(java.sql.SQLException se){
}
try{
if(stmt!=null)
stmt.close();
}catch(java.sql.SQLException se){
}
try{
if(conn != null )
conn.close();
}catch(java.sql.SQLException se){
}
}