📄 operatedbbook.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -