⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pageableresultset2.java

📁 网上书店 JSP+ACCESS的代码下载
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package myPk;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.Ref;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;

public class PageableResultSet2 implements Pageable {
    protected java.sql.ResultSet rs=null;
    protected int rowsCount;
    protected int pageSize;
    protected int curPage;
    protected String command = "";
    
	public int getCurPage() {
		// TODO 自动生成方法存根
	    return curPage;
	}

	public int getPageCount() {
		// TODO 自动生成方法存根
	    if(rowsCount==0) return 0;
	    if(pageSize==0) return 1;
	    //calculate PageCount
	    double tmpD=(double)rowsCount/pageSize;
	    int tmpI=(int)tmpD;
	    if(tmpD>tmpI) tmpI++;
	    return tmpI;
	}

	public int getPageRowsCount() {
		// TODO 自动生成方法存根
	    if(pageSize==0) return rowsCount;
	    if(getRowsCount()==0) return 0;
	    if(curPage!=getPageCount()) return pageSize;
	    return rowsCount-(getPageCount()-1)*pageSize;
	}

	public int getPageSize() {
		// TODO 自动生成方法存根
	    return pageSize;
	}

	public int getRowsCount() {
		// TODO 自动生成方法存根
	    return rowsCount;
	}

	public void gotoPage(int page) {
		// TODO 自动生成方法存根
	    if (rs == null)
	        return;
	    if (page < 1)
	        page = 1;
	    if (page > getPageCount())
	        page = getPageCount();
	    int row = (page - 1) * pageSize + 1;
	    try {
	        rs.absolute(row);
	        curPage = page;
	    }
	    catch (java.sql.SQLException e) {
	    }
	}

	public void pageFirst() throws SQLException {
		// TODO 自动生成方法存根
	    int row=(curPage-1)*pageSize+1;
	    rs.absolute(row);
	}

	public void pageLast() throws SQLException {
		// TODO 自动生成方法存根
	    int row=(curPage-1)*pageSize+getPageRowsCount();
	    rs.absolute(row);
	}

	public void setPageSize(int pageSize) {
		// TODO 自动生成方法存根
	    if(pageSize>=0){
	        this.pageSize=pageSize;
	        curPage=1;
	    }
	}

	public boolean absolute(int row) throws SQLException {
		// TODO 自动生成方法存根
		return false;
	}

	public void afterLast() throws SQLException {
		// TODO 自动生成方法存根

	}

	public void beforeFirst() throws SQLException {
		// TODO 自动生成方法存根

	}

	public void cancelRowUpdates() throws SQLException {
		// TODO 自动生成方法存根

	}

	public void clearWarnings() throws SQLException {
		// TODO 自动生成方法存根

	}

	public void close() throws SQLException {
		// TODO 自动生成方法存根

	}

	public void deleteRow() throws SQLException {
		// TODO 自动生成方法存根

	}

	public int findColumn(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public boolean first() throws SQLException {
		// TODO 自动生成方法存根
		return false;
	}

	public Array getArray(int i) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Array getArray(String colName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public InputStream getAsciiStream(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public InputStream getAsciiStream(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public BigDecimal getBigDecimal(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public BigDecimal getBigDecimal(int columnIndex, int scale)
			throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public BigDecimal getBigDecimal(String columnName, int scale)
			throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public InputStream getBinaryStream(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public InputStream getBinaryStream(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Blob getBlob(int i) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Blob getBlob(String colName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public boolean getBoolean(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return false;
	}

	public boolean getBoolean(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return false;
	}

	public byte getByte(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public byte getByte(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public byte[] getBytes(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public byte[] getBytes(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Reader getCharacterStream(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Reader getCharacterStream(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Clob getClob(int i) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Clob getClob(String colName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public int getConcurrency() throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public String getCursorName() throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Date getDate(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Date getDate(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Date getDate(int columnIndex, Calendar cal) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Date getDate(String columnName, Calendar cal) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public double getDouble(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public double getDouble(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public int getFetchDirection() throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public int getFetchSize() throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public float getFloat(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public float getFloat(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public int getInt(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public int getInt(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public long getLong(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public long getLong(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public ResultSetMetaData getMetaData() throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Object getObject(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Object getObject(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Object getObject(int arg0, Map<String, Class<?>> arg1)
			throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Object getObject(String arg0, Map<String, Class<?>> arg1)
			throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Ref getRef(int i) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Ref getRef(String colName) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public int getRow() throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public short getShort(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public short getShort(String columnName) throws SQLException {
		// TODO 自动生成方法存根
		return 0;
	}

	public Statement getStatement() throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public String getString(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public String getString(String columnName) throws SQLException {
		// TODO 自动生成方法存根
	    try {
	        return rs.getString(columnName);
	    }
	    catch (SQLException e) 
	    {
	    	//这里是为了增加一些出错信息的内容便于调试
	        throw new SQLException (e.toString()+" columnName="+columnName+" SQL="+"this.getCommand()");
	    }
	}

	public Time getTime(int columnIndex) throws SQLException {
		// TODO 自动生成方法存根
		return null;
	}

	public Time getTime(String columnName) throws SQLException {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -