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")); //²éÑ
Ïà¹ØÎĵµ£º
OracleÖÐÈçºÎÓÃÒ»ÌõSQL¿ìËÙÉú³É10ÍòÌõ²âÊÔÊý¾Ý
×öÊý¾Ý¿â¿ª·¢»ò¹ÜÀíµÄÈ˾³£Òª´´½¨´óÁ¿µÄ²âÊÔÊý¾Ý£¬¶¯²»¶¯¾ÍÐèÒªÉÏÍòÌõ£¬Èç¹ûÒ»ÌõÒ»ÌõµÄ¼È룬
ÄÇ»áÀË·Ñ´óÁ¿µÄʱ¼ä£¬±¾ÎĽéÉÜÁËOracleÖÐÈçºÎͨ¹ýÒ»ÌõSQL¿ìËÙÉú³É´óÁ¿µÄ²âÊÔÊý¾ÝµÄ·½·¨¡£
²úÉú²âÊÔÊý¾ÝµÄSQLÈçÏ£º
SQL> select rownum as id,
&nb ......
1.Óû§¹ÜÀí
£¨1£©½¨Á¢Óû§£¨Êý¾Ý¿âÑéÖ¤£©
CREATE USER smith
IDENTIFIED BY smith_pwd
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp
QUOTA 5m ON users;
£¨2£©ÐÞ¸ÄÓû§
ALTER USER smith
QUOTA 0 ON SYSTEM;
£¨3£©É¾³ýÓû§
DROP USER smith;
DROP USER ......
oracle ͬÒå´Ê synonym ΪÊý¾Ý¿â¶ÔÏó½¨Á¢Í¬Òå´Êºó,µ±dba¶ÔÊý¾Ý¿â¶ÔÏó(table,view,ÐòÁÐ)×öÁËÒ»¸ö¼òµ¥¸Ä¶¯Ö®ºó,ÈçÃû×Ö»òÕ߽ṹ¸Ä±ä,Ôò²»ÐèÒªÖØиü¸Ä²¢±àÒëÓ¦ÓÃ.ÔÚÊý¾Ý¿â×ÖµäÖÐÓж¨Òå,²»ÐèÒª½øÐÐÈκδ洢.
oracle±ðÃûalias,With as¡¡Éú³ÉÒ»¸öÁÙʱ±í£¬¶ÔÓÚ¸´ÔÓµÄÊý¾Ý²éѯ£¬¿ÉÒÔ¼õÉÙ×ÊÔ´ÏûºÄ¡¢Ìá¸ßÐÔÄÜ¡£9iÒýÈë¡£
with alias ......
jspÖÐincludeµÄÁ½ÖÖÐÎʽ: 1.<%@ include file=” ”%>
&nbs ......