oracle+jspÖÐblobÀàÐÍ´æ´¢´óÎı¾ÎÊÌâ½â¾ö·½·¨
oracle+jspÖÐblobÀàÐÍ´æ´¢´óÎı¾ÎÊÌâ½â¾ö·½·¨
oracle ´æ´¢´óÎı¾Ò»Ö±ÊÇÒ»¸ö¼¬ÊÖµÄÎÊÌâ¡£
Ò»¡¢´æÊý¾Ý¿â£º
<%@page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%
//¶¨Òå±äÁ¿
java.sql.Connection conn; //Êý¾Ý¿âÁ¬½Ó¶ÔÏó
String sql;
long id;
ResultSet rs;
Statement stmt,stmt1;
java.sql.DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); //×°ÔØJDBCÇý¶¯³ÌÐò
conn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.2:1521:lqxm","lqxm","lqxm"); //Á¬½ÓÊý¾Ý¿â
request.setCharacterEncoding("GBK");
String title = request.getParameter("title");
String content = request.getParameter("content");
String sort = request.getParameter("sort");
String type = request.getParameter("type");
String rq = request.getParameter("rq");
String qy = request.getParameter("qy");
//²åÈëÊý¾Ý,´Ëʱblob×Ö¶ÎÖвåÈëµÄÊÇ¿ÕÖµ
sql="insert into t_flfg (xlh,title,content,rq,sort,type,qy) ";
sql=sql+"Values(FLFG_SEQ.NEXTVAL,'" + title + "',empty_clob(),'" + rq + "','" + sort + "','" + type + "','" + qy + "')";
stmt=conn.createStatement();
stmt.executeUpdate(sql);
conn.commit();
conn.setAutoCommit(false);
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
//È¡µÃ¸Õ²Å²åÈëµÄID
sql="select max(xlh) as xlh from t_flfg ";
rs=stmt.executeQuery(sql);
if(rs.next()) {
id=rs.getInt("xlh");
}
rs.close();
sql = "select content from t_flfg where xlh="+id+" for update";
rs = stmt.executeQuery(sql);
if (rs.next()) {
oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob(1);
clob.putString(1, content);
sql = "update t_flfg set content=? where xlh=" + id + ""; //½«´óÎı¾¸üнøÈ¥£¬ºÇºÇ
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setClob(1, clob);
pstmt.executeUpdate();
}
conn.commit();
stmt.close();
conn.close();
%>
¶þ¡¢¼ìË÷ÏÔʾÊý¾Ý£º
<%
ResultSet rs = flfgSave.searchOneInfo(request.getParameter("xlh")); //²éÑ
Ïà¹ØÎĵµ£º
1.½ûÖ¹¿Í»§¶Ë»º´æÒªÔÚ<head>ÖмÓÈëÀàËÆÈçÏÂÄÚÈÝ£º
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
2.ÔÚ·þÎñÆ÷µÄ¶¯Ì¬ÍøÒ³ÖнûÖ¹»º´æ£¬Òª¼ÓÈëÀàË ......
1.Êý¾Ý¿âµÄË÷Òý
¿ÉÒÔ½«Ë÷Òý¸ÅÄîÓ¦Óõ½Êý¾Ý¿â±íÉÏ¡£µ±Ò»¸ö±íº¬ÓдóÁ¿µÄ¼Ç¼ʱ£¬Oracle²éÕҸñíÖеÄÌØд¼Ç¼Ҫ»¨ºÜ³¤µÄʱ¼ä——¾ÍÏñ»¨ºÜ³¤Ê±¼ä·¿´È«ÊéÀ´²éÕÒij¸öÖ÷ÌâÒ»Ñù¡£OracleÓÐÒ»¸öÒ×ÓÚʹÓõŦÄÜ£¬¼´¿ÉÒÔ½¨Á¢Ò»¸ö´ÎÒþ²Ø±í£¬¸Ã±í°üº¬Ö÷±íÖеÄÒ»¸ö»ò¶à¸öÖØÒªµÄÁУ¬ÒÔ¼°ÔÚÖ÷± ......
´ÓÍøÉϲéÕÒ×ÊÁÏjava/jsp»ñµÃ¿Í»§¶Ë(IE)Íø¿¨MACµØÖ·µÄ·½·¨´ó¸ÅÓÐÈýÖÖ¡£
1¡¢Í¨¹ýÃüÁʽ£¬ÔÚ¿Í»§¶ËÖ´ÐÐIpconfig µÈµÈ
2¡¢Í¨¹ýActiveXµÄ·½·¨
3¡¢Í¨¹ýÏò137µÄ¶Ë¿Ú·¢ËͲéѯָÁîµÄ·½·¨
¼ò½é£º
µÚÒ»ÖÖ·½·¨,ÔÚÕæÕýÓõ½Ê±ºò²»ÖªµÀΪʲô»ñµÃmacµØÖ·µÄÖ¸Áî×èÈûÁË,²»ÍùϼÌÐøÖ´ÐС£¶øÇÒËÙ¶ÈÊÇÕâÈýÖÖ·½·¨ÖÐ×îÂýµÄÒ»ÖÖ¡£
´úÂëÈçÏ ......
1¡¢jspÒ³ÃæÂÒÂ룺
ÔÚjspÒ³Ã濪ʼÌí¼Ó<%pageEncoding="uft-8"%>
2¡¢servletÊä³öÂÒÂ룺
ÔÚÊä³öÄÚÈÝ֮ǰ£¬ÏÈÖ´ÐÐresponse.setContentType
("text/html;charset=utf-8")
3¡¢ÔÚformÀïÓÃpost·½Ê½Ìá½»²ÎÊý£º
1£©½ÓÊÕʱ¼Órequest.setCharacterEncoding("utf-8")
2£©Ê¹ÓùýÂËÆ÷£¬ÔÚ½ÓÊÕ²ÎÊý֮ǰ£¬É趨´«µÝµÄ²ÎÊýÄ ......
<%@ page autoFlush="false" contentType="text/html;charset=utf-8" language="java" import="java.io.*,java.awt.Image,java.awt.image.*,com.sun.image.codec.jpeg.*,java.sql.*,com.jspsmart.upload.*,java.util.*,java.io.FileInputStream,java.io.FileOutputStream,java.awt.*"%>
<%@ page import="com.b ......