上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 50 下一页
摘要: 今天写了个程序往数据库插入100万条记录,代码如下Java代码 publicstaticvoid insertRecords() throws Exception { Connection conn = null; try { conn = DBUtil.getConnection(); conn.setAutoCommit(false); while (count < TOTALNUM) { PreparedStatement ps = conn.prepareStatement("select * from custfund limit ?"); ps.setIn 阅读全文
posted @ 2012-05-28 08:58 血马雄风 阅读(1813) 评论(0) 推荐(0)
摘要: 由于我们的项目不大,所以刚开始决定时我为了省事想用SSH,可是后来觉得只有Struts2好了,后来的查询等数据库操作我自己写方法不行了嘛!刚才写一个公共查询的方法,在增加参数时出了点错误,就是使用模糊查询时犯晕了。我写的方法如下:Java代码 /** * @说明 执行一条查询SQL语句,可以带参数 */publicstatic List<Object[]> excuteQuery(String sql, Object[] objs) { Connection conn = null; PreparedStatement psta = null; ResultSet rs = nul 阅读全文
posted @ 2012-05-28 08:57 血马雄风 阅读(419) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 50 下一页