Java连接数据库增删改查(12)

2021-04-06 00:35

一些基础的关于java jdbc的程序代码

count = y / 5 + 1;

}

if (i < count) {

x = ((++i) - 1) * 5;

String sql = "select top "

+ x

+ " * from (select * from bbc where name not in(select top " + x + " name from bbc order by name)) as A ";

list = query(sql);

} else if (i >= count) {

list = null;

}

return list;

}

public static int queryCount() {

int count = 0;

Connection conn = DBConnection.getConnection();

String sql = "select count(*) from bbc";

Statement stmt = null;

ResultSet rs = null;

try {

stmt = conn.createStatement();

rs = stmt.executeQuery(sql);

while (rs.next()) {

count = rs.getInt(1);

}

} catch (SQLException e) {

e.printStackTrace();

} finally {

try {

if (rs != null)

rs.close();

if (stmt != null)

stmt.close();

if (conn != null)

conn.close();

} catch (SQLException e) {

e.printStackTrace();

}

}

return count;

}


Java连接数据库增删改查(12).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2021会计顶岗实习计划(新编版)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: