点击这里给我发消息 ExternalInterface.call(new XML(""));

JDBC随笔

编辑器加载中...create tablespace epet datafile 'J:\文档\Worker\epet.dbf' size=10M -------------------------------创建表空间 create user sa identified by sx default tablespace epet ---------------------创建用户 grant connect,resource to sa ------------------------------- revoke connect ,resource to sa -------------------------撤销权限和角色 create table master( id number(11,0) primary key not null, loginid nvarchar2(50) not null, password nvarchar2(20) not null, status char(1) default(1) not null ); ---------------------创建主人表 comment on table master is '主人表'; comment on column master.id is '主人编号'; comment on column master.loginid is '主人登录的编号'; comment on column master.password is '主人登录的密码'; comment on column master.status is '主人登录的状态'; ----------------------添加注释 create sequence seq_id start with 1 increment by 1 nomaxvalue cache 10; -------------------创建主人表序列 insert into master values(seq_id.nextval,'lkl','lkl',1); select seq_id.currval from dual;//查看序列的当前的值 select seq_id.nextval from dual;//查看序列的下一个序列值 --------------------------------------插入数据 drop sequence seq_id; --------------删除当前的序列 *********************************************************************************************************************************************** oracle 常用的函数 1.日期处理函数 extract(),to_char(); 2.decode()函数 decode(value ,if1,then1,if2,then2,...,else); 3.nvl()函数 nvl(exp1,exp2); 如果表达式exp1的值是null,则返回exp2的值,否则返回exp1的值 ****************************************************************************************************************************************** oracle的索引 1.B书索引,位图索引,反向键索引 2.唯一索引,非唯一索引 3.单列索引,组合索引,基于函数的索引 create unique index adopt_time_index on pet(adopt_time desc); 唯一索引 create bitmap index type_id_bitmep_index on pet(type_id); 位图索引 create index health_love_index on pet(health,love); 组合索引 create index to_char_index on pet(to_char(adopt_time,'YYYY')); 基于函数的索引 create index master_id_reverse_index on pet(master_id) reverse; 反向键索引 drop index master_id_reverse_index; 删除在Pet表上创建的反向键索引 ---------------------------------------------------------------- 使用imp和exp导入导出数据 ********************************************************************************************************************************** 连接oracle数据库的语句 1.String driverName="oracle.jdbc.driver.OracleDriver"; 2.String url="jdbc:oracle:thin:@localhost:epet"; 3.String user="sa"; 4.String pwd="sx"; ********************************************************************************************************************************

posted @ 2012-04-15 20:50  程序员-小菜  阅读(224)  评论(0编辑  收藏  举报