Create Oracle Data Source
在Stand alone的环境中创建Oracle data source供测试使用:
OracleDataSource dataSource = new OracleDataSource();
dataSource.setDriverType("oracle.jdbc.driver.OracleDriver");
dataSource.setURL("jdbc:oracle:thin:@localhost:1521:ORCL");
dataSource.setUser("IIF");
dataSource.setPassword("oracle");
相关文档:
1。select * from a where a.rowid=(select min(b.rowid) from b where a.id=b.id);
create test1(
nflowid number primary key,
ndocid number,
drecvdate date);
insert into test1 values (1, 12301, sysdate) ;
insert into test1 values (2, 12301, sysdate);
select * from test1 order by drecvdate:
......
We are pleased to announce that Oracle has completed its acquisition of Sun Microsystems and Sun is now a wholly owned subsidiary of Oracle. With this news, we want to reiterate our commitment to deliver complete, open and integrated systems that help our customers improve the performance, reliabi ......
一、 常用日期数据格式
1.Y或YY或YYY 年的最后一位,两位或三位
SQL> Select to_char(sysdate,'Y') from dual;
TO_CHAR(SYSDATE,'Y')
--------------------
7
SQL> Select to_char(sysdate,'YY') from dual;
TO_CHAR(SYSDATE,'YY')
---------------------
07
SQL> Select to_char(sysdate,'YYY') from d ......
触发器是一种特殊的存储过程,它在插入,删除或修改特定表中的数据时触发执行,它比数据库本身标准的功能有更精细和更复杂的数据控制能力。数据库触发器有以下的作用:
* 安全性。可以基于数据库的值使用户具有操作数据库的某种权利。
# 可以基于时间限制用户的操作,例如不允许下班后和节假日修改数据库数据。 ......
【案例一】
题目:
--触发器:
--添加员工信息,流水号作为自动编号(通过序列生成),
--并且判断如果工资小于0,则改为0;如果大于10000,则改为10000。
CREATE TABLE emp2(
e_id NUMBER,
e_no NUMBER,
e_name VARCHAR2(20),
e_sal NUMBER
)
SELECT * from emp2;
CREATE SEQUENCE seq_trg_id;
INSERT INTO emp2(e_i ......