op_bookclass.java~2~
上传用户:tanyanyong
上传日期:2013-06-23
资源大小:1355k
文件大小:2k
源码类别:
电子政务应用
开发平台:
MultiPlatform
- package bookshop.run;
- /**
- * <p>Title: </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2004</p>
- * <p>Company: </p>
- * @author not attributable
- * @version 1.0
- */
- import java.util.*;
- import bookshop.util.*;
- import bookshop.book.*;
- import java.sql.*;
- public class op_bookclass extends DataBase{
- public op_bookclass() {
- }
- private Vector classlist; //图书类别向量数组
- public Vector getClasslist() {
- return classlist;
- }
- public String getBookClassSql() {
- sqlStr = "select id,classname from bookclass order by id";
- return sqlStr;
- }
- public boolean seachBookClass() throws Exception {
- int id = 0;
- String classname = "";
- int rscount = 0;
- try {
- rs = stmt.executeQuery(getBookClassSql());
- rscount = stmt.getMaxRows();
- classlist = new Vector(rscount+1);
- classlist.clear();
- while (rs.next()){
- id = rs.getInt("id");
- classname = rs.getString("classname");
- bookclass bc = new bookclass(id,classname);
- classlist.addElement(bc);
- }
- rs.close();
- return true;
- }
- catch (SQLException sqle){
- System.out.println(sqle);
- return false;
- }
- }
- };