1.windows命令行启动sqlplus:
sqlplus->user&pwd(连接到orcal: user:system pwd:000000)
2.查看当前日期: select sysdate from dual;
3.创建一个用户:
--method 1:
create user "username" identified by "pwd(打头不能位数字)";
grant connect,resource to "username";
--method 2:
grant dba to "username" identified by "pwd";
conn "username"/"pwd";
4.查询数据库域名:select parameter domain;
***************************
2009-3-12
1.user:system pwd:000000 rdb
--create a database
22:database configuration assistance. name: rdb
2--create a user
create user ht identified by ht;
grant create session,dba to ht;
commit;
3--login rdb with the identification of ht
user:ht pwd:ht db:rdb
4--create a table in rdb
create table company(
id integer primary key,
name varchar2(50)
);
insert into company(id,name)values(1,'ssdut');
insert into company(id,name)values(1,'going');
commit; (********** donnot forget! *********)
5--look the user's tables
select table_name,tablespace_name from user_tables;
----from Internet:
select table_name from user_tables;
select table_name from all_tables;
6--look the how many databases have?
orcale setup forder->admin->DB name == forder name
7--look all users in database
select username from all_users;
8--look the construct of a table
select column_id, column_name, data_type, data_length, data_precision,
data_scale,nullable,data_default from user_tab_columns where table_name
= 'tablename' order by column_id;
9--look current username:
show user
2009-3-13
1--insert into a time(format::timestamp 'year-month-day
hour:minute:second.millisecond)
insert into T_COMPANYINFO
(companycode,companyname,createtime,areacode)values
('aa','11',timestamp '2000-03-02 18:23:23.1234','0211');
2.
1.TYPE_FORWORD_ONLY,只可向前滚动;
2.TYPE_SCROLL_INSENSITIVE,双向滚动,但不及时更新,就是如果数据库里
的数据修改过,并不在ResultSet中反应出来。
3.TYPE_SCROLL_SENSITIVE,双向滚动,并及时跟踪数据库的更新,以便更改
ResultSet中的数据。
4.ResultSet.CONCUR_READ_ONLY:这是缺省值,指定不可以更新 ResultSet
5.ResultSet.CONCUR_UPDATABLE:指定可以更新 ResultSet
3.remote login the oracle
Net Configuration Assistance ->本地net服务名配置 ->服务器名:即数据库名,
主机名:远程主机ip地址
sql*plus界面登录:user:admin pwd:admin 主机字符串:rdb
dos命令行登录: sqlplus ->admin@rdb -> admin (format=> 用
户:user@database 密码:pwd)
2009-3-16
1.view the table structure
describe table_name;
desc table_name;
2.disconnect the database;
disconnect
relogin
connect
input your user name:admin#rdb
input your pwd:admin
3.
oracle jdbc位置
C:\Program Files\Java\jdk1.5.0_17\jre\lib\ext
阅读(984) | 评论(0) | 转发(0) |