上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 以下已经测试通过创建函数:create or replace function get_annual_sal(in_name varchar2) return numberisannual_sal number(9,1);begin select 16*t.salary-10000 into annual_sal from t_employee t where name=in_name; return annual_sal;end;1. 在PLsql中测试函数的运行结果select get_annual_sal('李红') from dual;执行结果2. 用PLsql中的sq 阅读全文
posted @ 2013-10-10 22:25 jmStatham 阅读(10421) 评论(0) 推荐(0) 编辑
摘要: 注意,以下内容转载自 : http://www.blogjava.net/fancydeepinMaven 确确实实是个好东西,用来管理项目显得很方便,但是如果是通过 Maven 来远程下载 JAR 包的话,我宿舍的带宽是4兆的,4个人共用,有时候用Maven 来远程下载 JAR 包会显得很慢,一般我发现下载速度不明显的时候,我就 Ctrl + C 来终止它的下载。然后改用手动来下载,因为用迅雷一类的工具来下载会快很多。我机子上 Maven 的本地仓库的很多 JAR 包我都是手动下载的。手动下载的话就会带来一个问题,就是,怎么样手动将下载下来的 JAR 包添加到 Maven 的本地仓库。关于这 阅读全文
posted @ 2013-10-05 22:57 jmStatham 阅读(5986) 评论(0) 推荐(0) 编辑
摘要: 今天使用myeclipse在非工作空间的路径下新建一个web项目,路径内包含了原有一些web项目,可是我在指定位置时,在那个路径下多写一个子目录的路径,以为myeclipse会为我默认新建子目录以便放置新建的项目的,然后等下我不要这个项目了,就删除掉,删除完后才知道一切完蛋了,它没有新建子目录的,而且我把我里面的项目全干掉了,坑爹的Myeclipse,真有病 阅读全文
posted @ 2013-10-04 17:26 jmStatham 阅读(256) 评论(0) 推荐(0) 编辑
摘要: select e.salary,--case 语句开始 case when salary between 12000 and 15000 then salary + 6000 else salary end new_salary--case 语句结束,可见也和存储过程等结束方式一样用end关键字,且这个case语句的作用只是用来计算一个新的列 from t_employee e;输出结果如下: 阅读全文
posted @ 2013-09-28 15:39 jmStatham 阅读(375) 评论(0) 推荐(0) 编辑
摘要: --本存储过程的功能:把test_tbl2中与test_tbl1中ID相同但salary不同的记录中的salary的值更新为test_tbl1中的salary的值--创建存储过程create or replace procedure p_update_test_tbl2 is--定义游标 cursor c_test_tbl2 is select t1.id, t1.salary from test_tbl2 t2, test_tbl1 t1 where t2.id = t1.id and t2.salary t1.salary; c_row c_test_tbl2%rowtype;begin. 阅读全文
posted @ 2013-09-28 15:07 jmStatham 阅读(2142) 评论(0) 推荐(0) 编辑
摘要: declare cursor c_test_tbl2 is select t2.id, t2.salary from test_tbl2 t2, test_tbl1 t1 where t2.id = t1.id and t2.salary t1.salary; c_row c_test_tbl2%rowtype;begin for c_row in c_test_tbl2 loop dbms_output.put_line(c_row.id || '-' || c_row.salary); end loop;end;PLsql中,输出结果如下: 阅读全文
posted @ 2013-09-28 14:48 jmStatham 阅读(1532) 评论(0) 推荐(0) 编辑
摘要: /**如何删除重复记录?*//*1. 先按重复字段分组 2. 在每组里找出最小的rowid 3. 把整个表中与上面查询出来的rowid不相等的记录删除掉*/delete from test_tbl2where rowid not in (select min(rowid) from test_tbl2 group by id); 阅读全文
posted @ 2013-09-28 13:54 jmStatham 阅读(325) 评论(0) 推荐(0) 编辑
摘要: /**1. 用select 创建相同表结构的表*/create table test_tbl2 as select * from test_tbl1 where 11;/** 2. 用insert into .. select 插入*/insert into test_tbl2(id,name,salary) select id,name,salary from test_tbl1 where id<6; 阅读全文
posted @ 2013-09-28 13:50 jmStatham 阅读(1169) 评论(0) 推荐(0) 编辑
摘要: 为什么静态的方法,只能访问静态资源(如静态属性或方法),却不能访问非静态资源?而非静态方法可以访问静态资源?-> 首先,非静态方法可以访问静态资源:比如产生了一个类的实例,调用实例的普通非静态方法,方法内部访问另外一个类的一些静态资源,如static final 类型的常量,这个很常用,容易理解。-> 其次,为什么静态方法不可以访问非静态资源?我们知道,静态属性和方法,是随着类的加载就已经加载进来了,此时类的实例并没有产生。假设虚拟机加载类A的静态方法f1时,f1内部访问了另外一个类B的非静态资源(如属性b),那么,我们知道,由于类的非静态资源只有类的实例可以访问,只有类产生了实例 阅读全文
posted @ 2013-09-24 21:26 jmStatham 阅读(648) 评论(0) 推荐(0) 编辑
摘要: 根据一篇文章,精简了一下关于线程同步的知识什么是线程同步,为什么要同步1. 线程同步=线程排队2. 多个线程访问共享的资源才需要同步3. 多个线程读取常量不用同步,读取变量才要同步,即涉及线程要要对数据修改才同步4. 多个线程访问共享资源的代码有可能是同一份代码,也有可能是不同的代码;无论是否执行同一份代码,只要这些线程的代码访问同一份可变的共享资源,这些线程之间就需要同步。如何线程同步1. 给共享资源的访问加同步锁(注意,为什么不是在每个对象里添加锁机制?没必要,因为同步是很耗资源的)2. 同步锁是加在访问共享资源的代码段上的3. 如果访问同一份共享资源,加的是不同的同步锁,并不起到同步的作 阅读全文
posted @ 2013-09-20 22:34 jmStatham 阅读(1412) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页