operatedbbook.java
来自「用最近的dojo1.2.1制作前端的ajax购书网站」· Java 代码 · 共 76 行
JAVA
76 行
package server.books;
import java.sql.*;
import server.database.*;
/**
* @author user
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
public class operateDbBook
{
//searchData dt=new searchData();
ResultSet rs=null;
ResultSet rs_temp=null;
Operation op=new Operation();
int CalSize(String sql)
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{ ResultSet rs_temp=null;
int size=0;
int wholePage=0;
if(rs_temp==null)
rs_temp=op.select(sql);
while(rs_temp.next())
{
size++;
}
rs_temp.close();
return size;
}
void moveRS(int t)
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{
t=(t-1)*searchData.getContent();
while(t>0&&rs.next())
{
t--;
}
}
/**
* Returns the rs.
* @return ResultSet
*/
ResultSet getRs(String sql,int instantpage)
throws SQLException,InstantiationException,IllegalAccessException,ClassNotFoundException
{
rs=op.select(sql);
moveRS(instantpage);
return rs;
}
/**
* Sets the rs.
* @param rs The rs to set
*/
public void setRs(ResultSet rs) {
this.rs = rs;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?