How to use JSP + MYSQL to create a message book (1)

Source: Internet
Author: User

(JSP + MySQL database to create a message book, first to create a MySQL database, on the use of MySQL Please download the http://pinghui.51.net/download/012mysql.chm tutorial. Now, for the purpose of illustration, we assume that the database has been created and the database name is pinghui, where the comment table records the message.

the database structure is:
+ ----------- + ------------- + ------ + ----- + ------------------- + ---------------- +
| FIELD | type | null | key | default | extra |
+ ----------- + --------------- + ------ + ----- + --------------------- + ---------------- +
| userid | int (11) | pri | 0 | auto_increment |
| username | char (20) ||||< br> | sex | char (2) |
| Address | char (40) | Yes | null |
| IP | char (15) |
| post | int (11) | Yes | 0 |
| OICQ | int (11) | Yes | 0 |
| ICQ | int (11) | Yes | 0 |
| telnumber | char (30) | Yes | null |
| comment | text | null |
| time | datetime ||| 0000-00-00 00:00:00 |< br> + ----------- + ------------- + ------ + ----- + --------------------- + ---------------- +

if you think it is too difficult to create a database,
the statement for creating a database is:
drop database if exists pinghui;
Create Database pinghui;
Use pinghui;
Create Table comment (
userid int not null default 0 auto_increment primary key,
username char (20) not null,
sex char (2),
address char (40),
ip char (15) not null,
post int default 0,
OICQ int default 0,
ICQ int default 0,
telnumber char (30),
comment text not null,
time datetime not null
);
insert into comment (username, IP, comment, time) values ("pinghui", "127.0.0.1",
"hello, please go to ping Hui free space to view information! ", Now ();
insert into comment (username, sex, address, IP, post, OICQ, ICQ, telnumber, comment, time)
values ('pinghui', 'male', 'address', '2017. 0.0.1 ', 250100,2269101, 74875874, '2017-100',
' Hello, please go to ping Hui free space to view your message! Thank you! ', Now ();
it is more convenient to explain the following information with the database. Continue the establishment of the message book

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.