2012年12月10日
摘要: Hibernate核心类和接口Configuraion类(1)管理hibernate的配置信息(2)读取加载hibernate.cfg.xml配置文件中指定连接数据库的驱动、用户名、密码、url(3)管理( *.hbm.xml)对象关系文件hibernate.cfg.xml文件(1)hibernate核心文件,用于指定各个参数,默认放在src目录下(2)指定连接数据库的驱动、用户名、密码、url(3)指定对象关系映射文件的位置注:也可以使用hibernate.properties文件来替代该文件(推荐使用 hibernate.cfg.xml)对象关系映射文件(*.hbm.xml)//建立表和类 阅读全文
posted @ 2012-12-10 20:30 Chenyong Liu 阅读(342) 评论(0) 推荐(0)
2012年11月13日
摘要: 1、每个action都是单例,包括ActionServlet2、在一个项目中配置多个struts-config.xml文件例如: <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-IN 阅读全文
posted @ 2012-11-13 19:45 Chenyong Liu 阅读(108) 评论(0) 推荐(0)
2012年11月4日
摘要: dtd(document type definition)1、用于约束xml的文档规范2、引入dtd文件方式有哪些?(1)本地引用如:(2)引入一个公开的dtd如:3、dtd元素(1)如:注意:元素类型必须大写,且为以下三种之一 EMPTY:该元素不能包含子元素和普通文本字符串,但可以有属性(空元素) ANY:该元素可以包含任何在DTD中定义的子元素和普通字符串及其他们的混合 (#PCDATA):表示元素中嵌套的内容是普通文本字符串 (name,#PCDATA):表示文本字符串和其他元素的混合(2)dtd元素修饰符:?:0到1+:1到多*:0到多|:表示选择():给元素分组,:表示元素出现顺序 阅读全文
posted @ 2012-11-04 21:47 Chenyong Liu 阅读(176) 评论(0) 推荐(0)
2012年10月28日
摘要: 1 做人做事2 公众表现力3 思考与总结 阅读全文
posted @ 2012-10-28 23:24 Chenyong Liu 阅读(128) 评论(0) 推荐(0)
2012年10月25日
摘要: xml可以做什么用?1、可作为程序间通信的标准2、做配置文件3、充当小型数据库xml元素命名规范:1、区分大小写,例如:和是两个不同的标记2、不能以数字或下划线"_"开头3、不能包含空格,名称中间不能包含冒号注意点:每个xml文件有且只有一个根元素xml文件中空格和换行都被当做标签内容处理,例如(1)和(2)是不同的:(1)lcy(2)lcy 阅读全文
posted @ 2012-10-25 16:38 Chenyong Liu 阅读(127) 评论(0) 推荐(0)
2012年10月22日
摘要: //alter user scott identified by root;jsp文件翻译成servlet后存放的路径C:\Program Files\apache-tomcat-7.0.27\work\Catalina\localhost\JSP\org\apache\jsphibernate 是对jdbc进行轻量级封装的ORM框架,充当项目的持久层把对象持久化: 把对象的信息保存到数据库或者是文件为什么使用hibernate?1、切换数据库需要重新编写sql2、使用jdbc操作数据库,sql语句编写比较麻烦3、程序员只想关注业务本身而不去关注使用哪种数据库hibernate所需的库:1、核 阅读全文
posted @ 2012-10-22 17:38 Chenyong Liu 阅读(214) 评论(0) 推荐(0)
2012年8月17日
摘要: create table log_table( username varchar2(20), logon_time date, logoff_time date, address varchar2(20));create or replace trigger sys_trig1after logon on databasebegin insert into log_table(username,logon_time,address) values(ora_login_user,sysdate,ora_client_ip_address);end;create or replace trigge 阅读全文
posted @ 2012-08-17 08:14 Chenyong Liu 阅读(188) 评论(0) 推荐(0)
2012年8月16日
摘要: create or replace trigger trig1after insert on scott.testbegin dbms_output.put_line('添加成功...');end;create or replace trigger trig2after update on scott.testfor each row/*行触发,默认是表触发*/begin dbms_output.put_line('修改成功...');end;create or replace trigger trig3before delete on scott.testbe 阅读全文
posted @ 2012-08-16 16:27 Chenyong Liu 阅读(148) 评论(0) 推荐(0)
摘要: create or replace view my_view as select ename,job,sal,comm from emp;create or replace view my_view as select ename,job,sal,comm from emp with read only;create or replace view my_view as select emp.ename,dept.deptno,dept.dname from emp,dept where emp.deptno=dept.deptno with read only;drop view my_vi 阅读全文
posted @ 2012-08-16 16:26 Chenyong Liu 阅读(181) 评论(0) 推荐(0)
摘要: create or replace procedure my_pro5(v_deptno number) istype my_cursor is ref cursor;v_cursor my_cursor;v_ename emp.ename%type;v_sal emp.sal%type;begin open v_cursor for select ename,sal from emp where deptno=v_deptno; loop fetch v_cursor into v_ename,v_sal;/***游标向下移动***/ exit when v_cursor%notfound; 阅读全文
posted @ 2012-08-16 12:10 Chenyong Liu 阅读(221) 评论(0) 推荐(0)