摘要: /** * 负责数据库连接定义的程序类 * 该类可以负责所有操作线程的数据库连接,利用get()方法可以获得连接对象 */ public class DatabaseConnection { private static final String DBDRIVER = "oracle.jdbc.driver.OracleDriver" ; private static fi... 阅读全文
posted @ 2017-09-07 17:10 scwyfy 阅读(2257) 评论(0) 推荐(0) 编辑
摘要: /** * 分页查询 */ int currentPage=3;//当前页码 int pageSize=5;//每页的记录条数 String sql=" select * from " + "(select mid,name,age,birthday,note,rownum rn f... 阅读全文
posted @ 2017-09-07 14:35 scwyfy 阅读(425) 评论(0) 推荐(0) 编辑
摘要: /** * PreparedStatement: * 更新操作:public int executeUpdate() * 查询操作:public Result executeQuery() * 填充数据:public void setXxx(int index,值)//注意index是从1开始 * * 注意:在使用PreparedStatement操作Date数据时,使用... 阅读全文
posted @ 2017-09-07 10:54 scwyfy 阅读(166) 评论(0) 推荐(0) 编辑