📄 categoryimpl.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package com.ebook.impl;import com.ebook.dao.*;import java.util.*;import java.sql.*;import com.ebook.Entity.*;/** * * @author 隆科 */public class CategoryImpl implements CategoryDao { Connection con; public CategoryImpl(Connection con) { this.con = con; } public ArrayList getCategory() throws Exception { ArrayList list = new ArrayList(); PreparedStatement pstm; String sql = "select* from category"; pstm = con.prepareStatement(sql); ResultSet rs = pstm.executeQuery(); while(rs.next()) { Category c= new Category(); c.setCateid(rs.getInt("Cateid")); c.setCatename(rs.getString("Catename")); list.add(c); } return list; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -