今天决定做一个文章管理系统,struts +hibernate+spring +oracle , 准备在实践中进一步学习oracle 和各种开发 框架;
第一步,数据库设计:
工具: PowerDesigner Trial
SQL语句:
程序代码
create table NEW_OBJ (
ID NVARCHAR2(20) not null,
NAME NVARCHAR2(30),
orDERID NVARCHAR2(20),
ADDTIME DATE,
constraint PK_NEW_OBJ primary key (ID)
);
alter table NEW_OBJ
add constraint FK_NEW_OBJ_REFERENCE_NEW_OBJ foreign key (ORDERID)
references NEW_OBJ (ID);
*****************************************
create table NEWS (
ID NVARCHAR2(30) not null,
TITLE NVARCHAR2(100),
SECTITLE NVARCHAR2(80),
AUTHOR NVARCHAR2(80),
orIGIN NVARCHAR2(100),
CONTENT CLOB,
VIEWTIMES INT,
ADDTIME DATE,
ADDER NVARCHAR2(40),
constraint PK_NEWS primary key (ID)
);
comment on column NEWS.ADDER is
' 发布者';
*************************************
create table NEWS_NEWOBJ (
ID NVARCHAR2(30) not null,
NEW_OBJ_ID NVARCHAR2(20),
NEWS_ID NVARCHAR2(30),
ADDTIME DATE,
constraint PK_NEWS_NEWOBJ primary key (ID)
);
alter table NEWS_NEWOBJ
add constraint FK_NEWS_NEW_REFERENCE_NEWS foreign key (NEWS_ID)
references NEWS (ID);
alter table NEWS_NEWOBJ
add constraint FK_NEWS_NEW_REFERENCE_NEW_OBJ foreign key (NEW_OBJ_ID)
references NEW_OBJ (ID);
为 了方便开发,我 们在oracle 中 新建一个ssh用户;
程序代码
Microsoft Windows XP [版 本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\zb>d:
D:\>sqlplus
SQL*Plus: Release 10.1.0.2.0 - Production on 星 期五 7月 27 13:32:02 2007
Copyright (c) 1982, 2004, oracle. All rights reserved.
请 输入用户名: school
请输入口令:
连接到:
oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Da
ta Mining options
SQL> create user ssh identified by ssh
2 ;
用 户已创建。
SQL> grant dba to ssh
2 ;
授权成功。
SQL> exit
从 oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options 断 开
SQL> create user ssh identified by ssh
2 ;
用 户已创建。
SQL> grant dba to ssh
2 ;
授权成功。
SQL> exit
从 oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options 断 开