📄 install.java
字号:
package com.laoer.bbscs.db;import java.sql.*;import java.io.*;import java.util.*;import com.laoer.bbscs.txthtml.*;/** * <p>Title: BBS-CS</p> * <p>Description: BBS-CS(BBS式虚拟社区系统)</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: loveroom.com.cn</p> * @author 龚天乙(laoer) * @version 3.0 */public class Install { String SQL = ""; DoText myDoText; DbTrans DBSQL; ResultSet rs = null; public Install() { this.DBSQL = new DbTrans(); this.myDoText = new DoText(); } public boolean creat_bbsconf() { SQL = "CREATE TABLE bbsconf (ID smallint(4) NOT NULL auto_increment, pagestyle tinyint(1) DEFAULT '1' NOT NULL, upimg tinyint(1) DEFAULT '2' NOT NULL, leftbgcolor varchar(10) NOT NULL,letftextcolor varchar(10) NOT NULL, rightbgcolor varchar(10) NOT NULL,righttextcolor varchar(10) NOT NULL,tablemaincolor varchar(10) NOT NULL, tabletintcolor varchar(10) NOT NULL, tabledarkcolor varchar(10) NOT NULL, left_a varchar(255) NOT NULL, left_alink varchar(255) NOT NULL,left_avisited varchar(255) NOT NULL, left_ahover varchar(255) NOT NULL,left_aactive varchar(255) NOT NULL,right_a varchar(255) NOT NULL, right_alink varchar(255) NOT NULL, right_avisited varchar(255) NOT NULL, right_ahover varchar(255) NOT NULL, right_aactive varchar(255) NOT NULL, website varchar(255) DEFAULT 'BBS-CS' NOT NULL, webURL varchar(255) DEFAULT 'www.laoer.com' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean careat_adminuser() { SQL = "CREATE TABLE adminuser (ID int(11) NOT NULL auto_increment, UID int(11) DEFAULT '0' NOT NULL, Uname varchar(20) NOT NULL, board tinyint(1) DEFAULT '0', superadmin tinyint(1) DEFAULT '0', bulletin tinyint(1) DEFAULT '0', useradmin tinyint(1) DEFAULT '0',PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_board() { SQL = "CREATE TABLE board (ID int(11) NOT NULL auto_increment, boardname varchar(20) NOT NULL,eboardname varchar(20) NOT NULL,bmaster varchar(20) NOT NULL, attrib tinyint(1) DEFAULT '0' NOT NULL, xu tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_boards() { SQL = "CREATE TABLE boards (ID int(11) NOT NULL auto_increment, boardID int(11) DEFAULT '0' NOT NULL, boardsname varchar(20) NOT NULL, eboardsname varchar(20) NOT NULL, bsmaster varchar(20) NOT NULL, bsmaster1 varchar(65), bsmaster2 varchar(20), boardgg text, attrib tinyint(1) DEFAULT '0' NOT NULL, usestate tinyint(1) DEFAULT '1' NOT NULL, xu tinyint(4) DEFAULT '0' NOT NULL, artcount int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_dy() { SQL = "CREATE TABLE dy (ID int(11) NOT NULL auto_increment, UID int(11) DEFAULT '0' NOT NULL, Uname varchar(20) NOT NULL, RID int(11) DEFAULT '0' NOT NULL, BID int(11) DEFAULT '0' NOT NULL, email_inform tinyint(1) DEFAULT '0' NOT NULL, msg_inform tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_elite() { SQL = "CREATE TABLE elite (ID int(11) NOT NULL auto_increment, PID int(11) DEFAULT '0' NOT NULL, rootID int(11) DEFAULT '0' NOT NULL, elitename varchar(60) NOT NULL, createuser varchar(20) NOT NULL, zluser varchar(20) NOT NULL,elitetime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_forum() { SQL = "CREATE TABLE forum ( id int(11) DEFAULT '0' NOT NULL, id1 varchar(11) DEFAULT '0' NOT NULL, id2 varchar(11) DEFAULT '0' NOT NULL, board char(3), boardname varchar(20), re int(8) DEFAULT '0' NOT NULL, bq char(2), UID int(11) DEFAULT '0' NOT NULL, name varchar(40), title varchar(60), detail text, sign varchar(255),artsize varchar(4) NOT NULL, email_inform tinyint(1) DEFAULT '0' NOT NULL, msg_inform tinyint(1) DEFAULT '0' NOT NULL, click int(8) DEFAULT '0' NOT NULL, time datetime, lasttime datetime,ip varchar(20), vtime datetime,new int(1) DEFAULT '0', nickname varchar(20), jd int(11) DEFAULT '0' NOT NULL, jdpid int(11) DEFAULT '0' NOT NULL,zc int(11) DEFAULT '0' NOT NULL, fd tinyint(4) DEFAULT '0' NOT NULL, cannotdel tinyint(1) DEFAULT '0' NOT NULL, delsign tinyint(1) DEFAULT '0' NOT NULL, deluserID int(11), delusername varchar(20), deltime datetime, delip varchar(20), cannotre tinyint(1) DEFAULT '0' NOT NULL, amend varchar(255), doelitename varchar(20), doelitetime datetime DEFAULT '0000-00-00 00:00:00', havepic tinyint(1) DEFAULT '0' NOT NULL,picname varchar(30), lastname varchar(50) DEFAULT '---' NOT NULL, lastre varchar(255) DEFAULT '---' NOT NULL, PRIMARY KEY (id))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_friend() { SQL = "CREATE TABLE friend ( ID int(11) NOT NULL auto_increment, UID int(11) DEFAULT '0' NOT NULL, Uname varchar(20) NOT NULL, FID int(11) DEFAULT '0' NOT NULL,Fname varchar(20) NOT NULL, comment varchar(255),PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_grzc() { SQL = "CREATE TABLE grzc (ID int(11) NOT NULL auto_increment, UID int(11) DEFAULT '0' NOT NULL, zc tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_guestbook() { SQL = "CREATE TABLE guestbook (ID int(11) NOT NULL auto_increment,UID int(11) DEFAULT '0' NOT NULL,Uname varchar(20) NOT NULL, FID int(11) DEFAULT '0' NOT NULL,Fname varchar(20) NOT NULL,mtype tinyint(1) DEFAULT '0' NOT NULL, note text NOT NULL, stime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, yd tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_guestuser() { SQL = "CREATE TABLE guestuser (ID int(11) DEFAULT '0' NOT NULL, guestname varchar(20) NOT NULL, glogintime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_mydata() { SQL = "CREATE TABLE mydata (ID int(11) NOT NULL auto_increment, UID int(11) DEFAULT '0' NOT NULL,height varchar(10),weight varchar(10),interest varchar(100), graduate varchar(40), favourpeople varchar(40), dreamjob varchar(40),favourart varchar(40),favourmusic varchar(40),favourplace varchar(40), favourmovie varchar(40), favourchat varchar(40), favourbook varchar(40),dreamlover varchar(40),favourteam varchar(40),homepage varchar(255),oicqno varchar(20), icqno varchar(20), sex tinyint(1) DEFAULT '0', brief text, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_photo() { SQL = "CREATE TABLE photo (ID int(11) NOT NULL auto_increment, UID int(11) DEFAULT '0' NOT NULL, Uname varchar(20) NOT NULL, picname varchar(255) NOT NULL,isstart tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_shuqian() { SQL = "CREATE TABLE shuqian (ID int(11) NOT NULL auto_increment,UID int(11) DEFAULT '0' NOT NULL,sqname varchar(255) NOT NULL,url varchar(255) NOT NULL, alt varchar(255), PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_sign() { SQL = "CREATE TABLE sign (ID int(11) NOT NULL auto_increment,UID int(11) DEFAULT '0' NOT NULL,sign_name1 varchar(30),sign_detail1 text, sign_name2 varchar(30),sign_detail2 text,sign_name3 varchar(30), sign_detail3 text, PRIMARY KEY (ID, UID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_unpost() { SQL = "CREATE TABLE unpost (ID int(11) NOT NULL auto_increment,bid int(11) DEFAULT '0' NOT NULL,UID int(11) DEFAULT '0' NOT NULL, Uname varchar(20) NOT NULL, MID int(11) DEFAULT '0' NOT NULL, Mname varchar(20) NOT NULL, unpostreason varchar(255),unposttime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_user() { SQL = "CREATE TABLE user (ID int(11) NOT NULL auto_increment, name varchar(20) NOT NULL,nick varchar(20) NOT NULL, passwd varchar(40) NOT NULL, passwd1 varchar(40) NOT NULL,email varchar(255) NOT NULL,question varchar(255) NOT NULL,answer varchar(255) NOT NULL, logintime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, likai datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, cishu int(11) DEFAULT '0' NOT NULL, post tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean creat_userdata() { SQL = "CREATE TABLE userdata (ID int(11) NOT NULL auto_increment,UID int(11) DEFAULT '0' NOT NULL, exp int(11) DEFAULT '0' NOT NULL,bx int(11) DEFAULT '0' NOT NULL, artunm int(11) DEFAULT '0' NOT NULL, staytime int(11) DEFAULT '0' NOT NULL, nstaytime int(11) DEFAULT '0' NOT NULL, power int(4) DEFAULT '0' NOT NULL, hpower int(4) DEFAULT '0' NOT NULL, PRIMARY KEY (ID))"; try { DBSQL.executeUpdate(SQL); return true; } catch (SQLException e) { return false; } } public boolean adddata() { SQL = "INSERT INTO user VALUES ( '1', 'SYSOP', 'SYSOP', 'abcd1234', 'E19D5CD5AF0378DA05F63F891C7467AF', 'webmaster@laoer.com', 'who?', 'webmaster', '2002-05-18 00:00:00', '0000-00-00 00:00:00', '0', '0')"; String SQL1 = "INSERT INTO mydata (ID,UID) VALUES ( '1', '1')"; String SQL2 = "INSERT INTO userdata VALUES ( '1', '1', '0', '0', '0', '0', '0', '10', '10')"; String SQL3 = "INSERT INTO adminuser VALUES ( '1', '1', 'SYSOP', '0', '1', '0', '0')"; String SQL4 = myDoText.gb2iso("INSERT INTO bbsconf VALUES ( '1', '2', '1', '#DE940A', '#FFFFFF', '#FFFFFF', '#000000', '#D38F10', '#F7F1E1', '#ECE6CE', 'color: #FFFFFF; text-decoration: none', 'text-decoration: none; color: #FFFFFF; font-family: 宋体', 'text-decoration: none; color: #FFFFFF; font-family: 宋体', 'text-decoration: underline; color: #CCCCCC', 'text-decoration: underline; color: #CCCCCC', 'color: #D38F10; text-decoration: none', 'text-decoration: none; color: #D38F10; font-family: 宋体', 'text-decoration: none; color: #D38F10; font-family: 宋体', 'text-decoration: underline; color: #FF0000', 'text-decoration: underline; color: #FF0000', '虚拟社区[BBS-CS]', 'WWW.LAOER.COM')"); try { DBSQL.executeUpdate(SQL); DBSQL.executeUpdate(SQL1); DBSQL.executeUpdate(SQL2); DBSQL.executeUpdate(SQL3); DBSQL.executeUpdate(SQL4); return true; } catch (SQLException e) { return false; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -