Oracle大数据量分页显示的初步实现
Oracle大数据量分页显示的初步实现
代码才是硬道理,本人喜欢把话语权交给代码,请往下看。。
首先是web.xml文件
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
- <servlet>
- <servlet-name>Mp3</servlet-name>
- <servlet-class>com.jadyer.servlet.Mp3Servlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>Mp3</servlet-name>
- <url-pattern>/servlet/Mp3</url-pattern>
- </servlet-mapping>
- <!-- 在version="2.5"中,可以直接在<welcome-file-list>里执行Servlet应用 -->
- <welcome-file-list>
- <welcome-file>servlet/Mp3</welcome-file>
- </welcome-file-list>
- </web-app>
用到的实体类Mp3.java
这是我们自定义的异常类MyRuntimeException.java
- package com.jadyer.exception;
- /**
- * 自定义异常类
- */
- @SuppressWarnings("serial")
- public class MyRuntimeException extends RuntimeException {
- /**
- * 直接构造一个RuntimeException
- * @see 而不抛任何东西
- */
- public MyRuntimeException() {
- super();
- }
- /**
- * 只抛出提示信息
- * @param message---错误提示信息
- */
- public MyRuntimeException(String message) {
- super(message);
- }
- /**
- * 只抛出异常类对象
- * @param cause-----所抛出的异常类对象
- */
- public MyRuntimeException(Throwable cause) {
- super(cause);
- }
- /**
- * 抛出提示信息和异常类对象
- * @param message---错误提示信息
- * @param cause-----所抛出的异常类对象
- * @see 一般情况下都使用该方法
- */
- public MyRuntimeException(String message, Throwable cause) {
- super(message, cause);
- }
- }
这是用于连接Oracle数据库的工具类OracleConnUtil.java
|
评论暂时关闭