跟学韩老师学习java-servlet篇之七连oracle数据库

25讲
create table users(
id number primary key,
username varchar2(32) not null,
email varchar2(64) not null,
grade number default 1,
passwd varchar(32) not null
);
1.用户名:scott密码:tiger;
2.set linesize 120;select * from emp;
3.create table users(
id number primary key,
username varchar2(32) not null,
email varchar2(64) not null,
grade number default 1,
passwd varchar(32) not null
);
insert into users values(1,'aaaa1','[email protected]',1,'123');
insert into users values(2,'aaaa2','[email protected]',1,'123');
insert into users values(3,'aaaa3','[email protected]',1,'123');
insert into users values(4,'aaaa4','[email protected]',1,'123');
insert into users values(5,'aaaa5','[email protected]',5,'123');
5.insert数据要commit[一定要注意]
26讲

4.复制,粘贴的servlet一定要注意这些,要在属性中改一个东西。因为他不会随首改动要变

第29讲

SELECT * FROM users ORDER BY id
SELECT t.*,ROWNUM rw FROM (SELECT * FROM users ORDER BY id) t WHERE ROWNUM<=6;
SELECT * FROM (SELECT t.*,ROWNUM rw FROM (SELECT * FROM users ORDER BY id) t WHERE ROWNUM<=6) m WHERE RW>=4;


3.统计出共有多少页
String s=request.getParameter("pageNow");
pageNow是空的时,要断一下,
int pageNow;
String s=request.getParameter("pageNow");
if(s !=null){
pageNow=Integer.parseInt(s);
}else{
pageNow=1;//当前页
}
所以说要学会看错误信息,那个空是在404中看到的

你可能感兴趣的:(oracle数据库)