摘要: 写入到数据库: @Test public void testwriteBlob() throws Exception{ Students s = new Students(1,"张三","男",new Date(),"河南"); //获取照片 File f = new File("/Users/li 阅读全文
posted @ 2017-12-05 23:16 liqy1991 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 1.hibernate使用步骤: 1)创建hibernate配置文件 2)创建持久化类 3)创建对象-关系映射 4)通过hibernate api编写访问数据库的代码 2.eclipse导入jar包: 偏好设置->java ->build path ->user libraries ->new 新建 阅读全文
posted @ 2017-12-04 23:12 liqy1991 阅读(912) 评论(0) 推荐(0) 编辑
摘要: 1.什么是ORM: orm:object/relational mapping 对象关系映射 2.使用orm框架的好处: 可以对数据库进行面向对象编程,不用自己编写sql语句,这样做的好处就是不用考虑使用了什么数据库,orm框架对数据库的操作进行了封装。 3.常用的orm框架有哪些: (1)hibe 阅读全文
posted @ 2017-12-04 20:43 liqy1991 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 1.什么是session: 当用户打开浏览器,访问某个网站的时候,服务器就会在服务器的内存为该浏览器分配一个内存空间,该空间被这个浏览器独占,这个空间就是session空间。 该空间中的数据默认存在时间为30min,可以修改(session.setMaxInactiveInterval(int se 阅读全文
posted @ 2017-11-28 01:37 liqy1991 阅读(1492) 评论(0) 推荐(0) 编辑
摘要: mysql自我复制: 当表中数据不够多的时候可以使用自我复制增加表中数据,用于测试。 insert into 表名(字段名)select 字段名 from 表名 阅读全文
posted @ 2017-11-27 00:00 liqy1991 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 分页算法需要的变量: pageSize:每页显示多少条 pageNow:要显示哪页 pageCount:一共多少页 rowCount:一共多少条记录 pageSize是指定好的,rowCount是从表中查询得到的,pageCount是计算出来的,计算公式为: if(rowCount%pageSize 阅读全文
posted @ 2017-11-26 17:56 liqy1991 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1.为什么会出现Jsp技术: 因为servlet写页面非常费劲 2.jsp是什么: jsp = html + java片段 + jsp标签 + javascript(css) 3.jsp语法: (1)指令: pagetaglib include (2)脚本元素: scriplet 表达式 decla 阅读全文
posted @ 2017-11-22 22:43 liqy1991 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1.请求的转发 使用RequestDispatcher接口,调用它的 特点: 发出一次请求 地址栏不变 在最终的servlet中,request对象和中专的那个request是一个对象 只能转发到当前web应用的资源 / :代表当前web应用的根目录 2.请求的重定向 特点: 发出两次请求 地址栏发 阅读全文
posted @ 2017-11-15 00:03 liqy1991 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Jsp(java server page)本质上是一个Servlet,可以放在WEB-INF目录以外的目录(因为此目录放的是一些隐私文件,不能直接访问到) Jsp共有9个内置对象: (1)request(就是HttpServletRequest对象) (2)response(HttpServletR 阅读全文
posted @ 2017-11-14 21:39 liqy1991 阅读(121) 评论(0) 推荐(0) 编辑
摘要: public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException{} request参数:封装了请求信息 (1)request.getParameter 阅读全文
posted @ 2017-11-13 20:57 liqy1991 阅读(435) 评论(0) 推荐(0) 编辑