oracle 笔记 VII 之 大数据量下的分页
在ORACLE 大数据量下的分页解决方法。一般用截取ID 方法,还有是三层 嵌套方法
一种分页方法
<%
int i = 1;
int numPages = 14;
String pages = request.getParameter("page");
int currentPage = 1;
currentPage = (pages == null)?1:Integer.parseInt(pages);
sql = "select count(*) from tables";
ResultSet rs = DBLink.executeQuery(sql);
第36页 共 59 页
while(rs.next())
i = rs.getInt(1);
int PageCount = 1;
PageCount = (i%numPage == 0) ?(i/numPages):(i/numPages+1);
int nextPage;
int up Page;
nextPage = currentPage + 1;
if(nextPage > = PageCount)
nextPage = PageCount;
upPage = currentPage - 1;
if(upPage <=1)
upPage = 1;
rs.close();
sql="select * from tables";
rs = DBLink.executeQuery(sql);
i = 0;
while((i<numPages*(currentPage-1)) && rs.next())
{ i++;}
//输出内容
//输出翻页连接
合计:<%=currentPage%>/<%=intPageCount%>页
<a href="List.jsp?page=1">第一页</a>
<a href="List.jsp?page=<%=upPage%>">上一页</a>
<%
for(int j=1;j<PageCount;j++){
if(currentPage != j)
&
相关文档:
oracle表空间操作详解
1
2
3作者: 来源: 更新日期:2006-01-04
5
6
7建立表空间
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
在Oracle中可以创建组合索引,即同时包含两个或两个以上列的索引。在组合索引的使用方面,Oracle有以下特点:
1、 当使用基于规则的优化器(RBO)时,只有当组合索引的前导列出现在SQL语句的where子句中时,才会使用到该索引;
2、 在使用Oracle9i之前的基于成本的优化器(CBO)时 ......
数据库版本:9.2.0.5
有时候我们可能不知道一个用户的密码,但是又需要以这个用户做一些操作,又不能去修改掉这个用户的密码,这个时候,就可以利用一些小窍门,来完成操作。
具体操作过程如下:
SQL*Plus: Release 9.2.0.5.0 - Production on 星期日 11月 21 13:32:34 2004
Copyright (c) 1982, ......
第一部分、SQL&PL/SQL
[Q]怎么样查询特殊字符,如通配符%与_
[A]select * from table where name like 'A_%' escape ''
[Q]如何插入单引号到数据库表中
[A]可以用ASCII码处理,其它特殊字符如&也一样,如
insert into t values('i'||chr(39)||'m'); -- chr(39)代表字符'
或者用两个单引号表示一个
or ......
1. ASCII
返回与指定的字符对应的十进制数;
SQL> select ascii(A) A,ascii(a) a,ascii(0) zero,ascii( ) space from dual;
A A ZERO SPACE
--------- --------- --------- ---------
65 97 48 32
2. CHR
给出整数,返回对应的字符;
SQL> select chr(54740) zhao,chr(65) chr65 from ......