• 大小: 2.32M
    文件类型: .zip
    金币: 2
    下载: 3 次
    发布日期: 2021-01-16
  • 语言: Java
  • 标签: java  how2j  糊涂账  

资源简介

java一本糊涂账 源码

资源截图

代码片段和文件信息

package dao;

import entity.Category;
import util.DBUtil;

import java.sql.*;
import java.util.ArrayList;
import java.util.List;

public class CategoryDAO {
    public int getTotal(){
        int total = 0;
        try(Connection c = DBUtil.getConnection(); Statement s = ((Connection) c).createStatement()){
            ResultSet rs = s.executeQuery(“SELECT COUNT(*) FROM category“);
            while(rs.next()){
                total = rs.getInt(“1“);
            }
        }catch (SQLException e){
            e.printStackTrace();
        }
        return total;
    }

    public void add(Category category){
        String sql = “INSERT INTO category(idname) VALUES(null?)“;
        try(Connection c = DBUtil.getConnection(); PreparedStatement ps = c.prepareStatement(sql)){
            ps.se

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-04-11 20:15  hutubill-master\
     目录           0  2020-04-11 20:14  hutubill-master\.idea\
     文件         288  2019-04-14 22:19  hutubill-master\.idea\encodings.xml
     目录           0  2020-04-11 20:14  hutubill-master\.idea\libraries\
     文件         513  2019-04-14 22:19  hutubill-master\.idea\libraries\chart.xml
     文件         208  2019-04-14 22:19  hutubill-master\.idea\libraries\liquidlnf.xml
     文件         250  2019-04-14 22:19  hutubill-master\.idea\libraries\mysql_connector_java_5_0_8_bin.xml
     文件         273  2019-04-14 22:19  hutubill-master\.idea\misc.xml
     文件         256  2019-04-14 22:19  hutubill-master\.idea\modules.xml
     文件        8792  2019-04-14 22:19  hutubill-master\.idea\uiDesigner.xml
     文件         167  2019-04-14 22:19  hutubill-master\.idea\vcs.xml
     文件        9732  2020-04-05 00:09  hutubill-master\.idea\workspace.xml
     文件         716  2019-04-14 22:19  hutubill-master\hutubill.iml
     目录           0  2020-04-11 20:14  hutubill-master\img\
     文件        1547  2019-04-14 22:19  hutubill-master\img\backup.png
     文件        1314  2019-04-14 22:19  hutubill-master\img\category1.png
     文件        2125  2019-04-14 22:19  hutubill-master\img\category2.png
     文件        1862  2019-04-14 22:19  hutubill-master\img\config.png
     文件        1292  2019-04-14 22:19  hutubill-master\img\home.png
     文件        1389  2019-04-14 22:19  hutubill-master\img\record.png
     文件        1225  2019-04-14 22:19  hutubill-master\img\report.png
     文件        1719  2019-04-14 22:19  hutubill-master\img\restore.png
     目录           0  2020-04-11 20:14  hutubill-master\lib\
     文件      167801  2019-04-14 22:19  hutubill-master\lib\chart.jar
     文件      373967  2019-04-14 22:19  hutubill-master\lib\liquidlnf.jar
     文件      540852  2019-04-14 22:19  hutubill-master\lib\mysql-connector-java-5.0.8-bin.jar
     文件     1447793  2019-04-14 22:19  hutubill-master\lib\swingx-core-1.6.2.jar
     目录           0  2019-04-14 22:19  hutubill-master\out\
     目录           0  2019-04-14 22:19  hutubill-master\out\production\
     目录           0  2020-03-19 00:30  hutubill-master\out\production\hutubill\
     目录           0  2020-04-11 20:14  hutubill-master\out\production\hutubill\dao\
............此处省略108个文件信息

评论

共有 条评论