如何读取oracle数据库中的图像并显示出来? 如何读取oracle数据库中的图像并显示出来?或将现有图像存入数据库中??用java或VC如何操作?请详细一些,多谢了,多谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 给你个例子,在JSP页面读取并显示oralce数据库表里的图片<%@ page language="java" import="java.sql.*,java.util.*"%><%@ page import="java.io.*" %><%@ page import="java.text.*" %><%@ page import="java.lang.*" %><html><body><%String sql = "select BLOB_COLUMN from UTL_LOB_TEST where id=2";ResultSet rs = null;try { Connection conn=null; Statement stmt=null; Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.131)(PORT = 1521)))(CONNECT_DATA = (SID = STUDY)(SERVER = DEDICATED)))","zhu","zhu"); stmt = conn.createStatement(); rs = stmt.executeQuery(sql); }catch (SQLException e) {System.out.println(e);}try { if (rs.next()) { response.setContentType("image/jpg"); ServletOutputStream myjpeg = response.getOutputStream(); byte [] image =rs.getBytes(1); myjpeg.write(image); myjpeg.flush(); myjpeg.close(); } } catch (Exception e) {System.out.println(e); PrintWriter toClient = response.getWriter(); response.setContentType("text/html;charset=gb2312"); toClient.write("无法打开图片!"); toClient.close(); } finally { //stmt.close(); //conn.close(); }%></body></html> 红旗系统 安装 oracle 10g 有经验的帮下忙 求PL-SQL语法 sql语句求解? 100分求救!!!火急求救!用vb向oracle中插入blob型数据时出现的问题!!!火急求救! 新手的oracle问题, 中文数据从 Oracle 到 SqlServer 传输的问题? 用ADO操作Oracle快照刷新 事务处理,如何得知语句执行情况! 一个关于索引的简单的问题(oracle菜鸟) 有没有人懂这个:char变形了 求pl/sql帮助文档 如何更改文本项内字的颜色?
<%@ page language="java" import="java.sql.*,java.util.*"%>
<%@ page import="java.io.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.lang.*" %>
<html>
<body>
<%
String sql = "select BLOB_COLUMN from UTL_LOB_TEST where id=2";
ResultSet rs = null;
try {
Connection conn=null;
Statement stmt=null;
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.131)(PORT = 1521)))(CONNECT_DATA = (SID = STUDY)(SERVER = DEDICATED)))","zhu","zhu");
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
}catch (SQLException e)
{System.out.println(e);}
try {
if (rs.next())
{
response.setContentType("image/jpg");
ServletOutputStream myjpeg = response.getOutputStream();
byte [] image =rs.getBytes(1);
myjpeg.write(image);
myjpeg.flush();
myjpeg.close();
}
} catch (Exception e)
{System.out.println(e);
PrintWriter toClient = response.getWriter();
response.setContentType("text/html;charset=gb2312");
toClient.write("无法打开图片!");
toClient.close();
} finally {
//stmt.close();
//conn.close();
}
%>
</body>
</html>