双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

求总数的函数怎么写

chitu11 chitu11 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我想从数据库当中求总数,但是不知道怎么写了

public int getMin(String str){
int count =0;
try {
Statement stmt = SumCard.getConnection().createStatement();
ResultSet rs = stmt.executeQuery(str) ;




} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return count;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new SumCard().getMin("select min(cjsj) from t_cards t ");
}



...全文
评论 5
收藏 已收藏
分享
返回顶部
chitu11
Java SE 62,621 成员 307,251 内容