html网页怎么通过jsp连接mysql数据库,并且读取数据库中得数据,和写入数据?

html网页怎么通过jsp连接mysql数据库,并且读取数据库中得数据,和写入数据?,第1张

1、导入.sql文件命令:mysql>

use

数据库名mysql>

source

d:/mysql.sql

2、建立数据库:mysql>

create

database

库名

3、建立数据表:mysql>

use

库名mysql>

create

table

表名

(字段名

varchar(20),

字段名

char(1))

4、删除数据库:mysql>

drop

database

库名

5、删除数据表:mysql>

drop

table

表名;

6、将表中记录清空:mysql>

delete

from

表名

7、往表中插入记录:mysql>

insert

into

表名

values

("hyq","m")

8、更新表中数据:mysql->

update

表名

set

字段名1='a',字段名2='b'

where

字段名3='c'

9、用文本方式将数据装入数据表中:mysql>

load

data

local

infile

"d:/mysql.txt"

into

table

表名

问题一

给你个小例子

//JSP接收客户端注册信息并输出

<%

String

username

=

request.getParameter("username")

String

password

=

request.getParameter("password")

String

con_password=

request.getParameter("con_password")

String

email

=

request.getParameter("email")

%>

用户名:<%=username

%><br/>

密码:<%=password

%><br/>

确认密码:<%=con_password

%><br/>

电子邮箱:<%=email

%>

问题二

需要明确需求写查询语句

还要知道你表的i相关字段

关联外键。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/9534279.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-29
下一篇2023-04-29

发表评论

登录后才能评论

评论列表(0条)

    保存