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%
相关文档:
(1)oracle数据库备份的导入对数据库的版本有要求,也即源数据库(导出产生备份的数据库)的版本要和目标数据库(导入数据库)的版本一致,否则可能导致导入失败。
(2)备份中的用户名(数据库导出时所使用的用户)和导入数据库的用户名最好一样,因为用户名和表空间命名有关系,如果不一样,导入就不能一次完成。也就是 ......
Oracle9i Database Release 2 Enterprise/Standard/Personal Edition for Windows NT/2000/XP
http://download.oracle.com/otn/nt/oracle9i/9201/92010NT_Disk1.zip
http://download.oracle.com/otn/nt/oracle9i/9201/92010NT_Disk2.zip
http://download.oracle.com/otn/nt/oracle9i/9201/92010NT_Disk3.zip
Oracle9i ......
1、创建表:
create table stud(
sid int,
sname varchar2(50)
)
并插入一条数据
&n ......
在我开发BS结构程序中,由于经常需要在ORACLE中处理一些容量较大的文本数据,所以经过反复测试终于用ASP成功解
决了大文本数据在ORACLE下存取问题。
一、运行环境:
1、Microsoft Windows 2000 Server + IIS 5.0
2、Oracle8i中文标准版
二、建立数据表:
CREATE TABLE SYSTEM.TEST(
B ......
九大对象:
内置对象(又叫隐含对象,有9个内置对象):不需要预先声明就可以在脚本代码和表达式中随意使用
1-out:
javax.servlet.jsp.JspWriter类型,代表输出流的对象。作用域为page(页面执行期)
request:javax.servlet.ServletRequest的子类型,此对象封装了由WEB浏览器或其它客户端生成地HTTP
请求的细节(参数 ......