`

java仿QQ源代码

阅读更多
一个用到SWING和socket通讯的仿QQ小项目,做的还不完善,主要的都弄了,可以拿去简单学习下。附数据库文件和源码文件。
数据库使用的是oracle,脚本,用户名密码均是qq:
-------------------------------------------------------
-- Export file for user QQ                           --
-- Created by Dream.YangLong on 2013-10-31, 13:25:48 --
-------------------------------------------------------

spool QQ.log

prompt
prompt Creating table USERS
prompt ====================
prompt
create table QQ.USERS
(
  QQNUM      NUMBER(10) not null,
  QQNAME     VARCHAR2(40),
  QQPASS     VARCHAR2(40),
  QQDESC     VARCHAR2(200),
  QQSEX      NUMBER(1),
  QQBIRTHDAY DATE,
  OFPIC      BLOB,
  OLPIC      BLOB,
  MESPIC     BLOB
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );
alter table QQ.USERS
  add constraint PK_USERS primary key (QQNUM)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table FRIENDS
prompt ======================
prompt
create table QQ.FRIENDS
(
  FRIID  NUMBER(10) not null,
  QQNUM  NUMBER(10),
  FRINUM NUMBER(10)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );
alter table QQ.FRIENDS
  add constraint PK_FRIENDS primary key (FRIID)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );
alter table QQ.FRIENDS
  add constraint FK_FRI_USER foreign key (FRINUM)
  references QQ.USERS (QQNUM);
alter table QQ.FRIENDS
  add constraint FK_FRI_USERS foreign key (QQNUM)
  references QQ.USERS (QQNUM);

prompt
prompt Creating table LOGIN_TYPE
prompt =========================
prompt
create table QQ.LOGIN_TYPE
(
  TYPEID   NUMBER(2) not null,
  TYPENAME VARCHAR2(40),
  TYPEDESC VARCHAR2(200)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );
alter table QQ.LOGIN_TYPE
  add constraint PK_LOGIN_TYPE primary key (TYPEID)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table LOGIN
prompt ====================
prompt
create table QQ.LOGIN
(
  QQNUM   NUMBER(10),
  TYPEID  NUMBER(2),
  LOGIP   VARCHAR2(15),
  LOGTIME DATE
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );
alter table QQ.LOGIN
  add constraint FK_LOG_TY foreign key (TYPEID)
  references QQ.LOGIN_TYPE (TYPEID);
alter table QQ.LOGIN
  add constraint FK_LOG_USER foreign key (QQNUM)
  references QQ.USERS (QQNUM);

prompt
prompt Creating table MES
prompt ==================
prompt
create table QQ.MES
(
  QQNUM   NUMBER(10),
  FRINUM  NUMBER(10),
  MES     VARCHAR2(300),
  MESDATE DATE
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255;

prompt
prompt Creating sequence SQ_FRI
prompt ========================
prompt
create sequence QQ.SQ_FRI
minvalue 1
maxvalue 999999999999999999999999999
start with 101
increment by 1
cache 20;

prompt
prompt Creating sequence SQ_QQNUM
prompt ==========================
prompt
create sequence QQ.SQ_QQNUM
minvalue 1
maxvalue 999999999999999999999999999
start with 1080
increment by 1
cache 20;

prompt
prompt Creating function FC_REGIST
prompt ===========================
prompt
CREATE OR REPLACE FUNCTION QQ.fc_regist(v_qqname VARCHAR2,v_qqpass VARCHAR2,v_qqdesc varchar2,v_qqsex NUMBER,v_qqbirthday DATE) RETURN NUMBER
IS
v_qqnum NUMBER(10);
BEGIN
  SELECT sq_qqnum.nextval INTO v_qqnum FROM dual;
  INSERT INTO USERS(qqnum,qqname,qqpass,qqdesc,QQSEX,qqbirthday) VALUES(v_qqnum,v_qqname,v_qqpass,v_qqdesc,v_qqsex,v_qqbirthday);
  RETURN v_qqnum;
  END fc_regist;
/


spool off

  • QQ.7z (244.9 KB)
  • 下载次数: 33
分享到:
评论
1 楼 lijingshou 2013-10-31  
感觉有学习价值..mark first

相关推荐

Global site tag (gtag.js) - Google Analytics