public int countAll(){ Connection connection= DBHelper.getConnection(); ResultSet rs=null; PreparedStatement ps =null; int i=0; String sql="select count(*) i from t_customer ta,t_user tu where ta.user_id=tu.id"; try { ps=connection.prepareStatement(sql); rs = ps.executeQuery(); if (rs.next()){ i=rs.getInt("i"); } } catch (SQLException e) { e.printStackTrace(); }finally { try { connection.close(); } catch (SQLException e) { e.printStackTrace(); } } return i; }
多表联查的查询
最新推荐文章于 2024-07-01 20:32:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)