易截截图软件、单文件、免安装、纯绿色、仅160KB

jsp分页(oracle+jsp+apache)

一 前提 
希望最新的纪录在开头给你的表建立查询:
表:mytable 
查询:create or replace view as mytable_view from mytable order by id desc 其中,最好使用序列号create sequence mytable_sequence 来自动增加你的纪录id号 
二 源程序 
<%String sConn="你的连接" 
Class.forName("oracle.jdbc.driver.OracleDriver"); 
Connection conn=DriverManager.getConnection(sConn,"你的用户名","密码"); 
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 
Statement stmtcount=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 
ResultSet rs=stmt.executeQuery("select * from mytable_view"); 
String sqlcount="select count(*) from mytable_view"; 
ResultSet rscount=stmtcount.executeQuery(sqlcount); 
int pageSize=你的每页显示纪录数; 
int rowCount=0; //总的记录数 
while (rscount 
int pageCount; //总的页数 
int currPage; //当前页数 
String strPage; 
strPage=request.getParameter("page"); 
if (strPage==null){ 
currPage=1; 

else{ 
currPage=Integer.parseInt(strPage); 
if (currPage<1) currPage=1; 

pageCount=(rowCount+pageSize-1)/pageSize; 
if (currPage>;pageCount) currPage=pageCount; 
int thepage=(currPage-1)*pageSize; 
int n=0; 
rs.absolute(thepage+1); 
while (n<(pageSize)&&!rs 
%>; 
<%rs.close(); 
rscount.close(); 
stmt.close(); 
stmtcount.close(); 
conn.close(); 
%>; 
//下面是 第几页等 
<form name="sinfo" method="post" action="sbinfo_index.jsp?condition=<%=condition%


相关文档:

JSP学习(一)

JSP基本语法
大部分JSP被一个以“<%” 开头和以“%>”结尾的的标记括在其中。在更新的JSP 1.1规范出台后,就有了与XML兼容的版本。
JSP指令和脚本元素
Directives <%@ directive %>
Declarations <%! declaration %>
Expressions <%= expression %>
Code Fragment/ ......

Oracle在windows下安装纪要


安装:
运行G:\install\setup.exe安装Oracle,但不创建启动数据库
创建数据库(使用Configuration And Migration Tools->DataBase Configuration Assistant)
创建监听程序(使用Configuration And Migration Tools->NetManager或者 Configuration And Migration Tools->Net Configuration Assistant)
创建服务 ......

oracle PL/SQL FOR UPDATE 与 FOR UPDATE OF的区别

PL/SQL-FOR UPDATE 与 FOR UPDATE OF的区别
url:http://hi.baidu.com/1413/blog/item/a521251f7e5993c4a686696b.html
数据库 oracle for update of   和   for update区别    
select * from TTable1 for update 锁定表的所有行,只能读不能写
2 select * from TTable1 wher ......

[推荐] 深度对比Oracle与SQL Server [1]

本译文采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议发布,转载请保留此信息
译者:马齿苋 | 链接:http://www.dbabeta.com/2010/oracle-sql-server-comparison-i.html
作者:Sadequl Hussain | 原文:http://www.sql-server-performance.com/articles/dba/oracle_sql_server_comparison_p1.aspx
一 ......

解除oracle数据库中所有外键约束SQL语句

begin
  for item in (select * from user_constraints a where a.constraint_type = 'R') loop
  execute immediate 'alter table ' || item.table_name || ' disable constraint ' || item.constraint_name;
  end loop;
end;
/ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号