第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

為什么寫了連接數(shù)據(jù)庫(kù)代碼 可是注冊(cè)的時(shí)候沒有反應(yīng)???麻煩各位大佬幫忙看一下 感謝!??!

注冊(cè)界面的jsp代碼:<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>? <head>? ? <base href="<%=basePath%>">? ??? ? <title>三井體育</title>? ?? <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0">? ?? <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> -->? ? ?<style>? ? ? ? body{? ? ? ? ? ? background: url("./image/loginBG.jpg");? ? ? ? ? ? background-repeat: repeat;? ? ? ? }? ? ? ? h1{? ? ? ? ? ? text-align: center;? ? ? ? ? ? font-family: 楷體;? ? ? ? ? ? color: gold;? ? ? ? ? ? margin-top: 100px;? ? ? ? }? ? ? ? #DD{? ? ? ? ? ? text-align: center;? ? ? ? ? ? width: 100%;? ? ? ? }? ? ? ? #XB{? ? ? ? ? ? margin-left: -90px;? ? ? ? }? ? </style>? </head>??? <body>? ? <h1>三井體育</h1><form id="DD" action="zhuceChack.jsp" method="post" onsubmit="return check(this)">? ? <fieldset>? ? ? ? <legend>注冊(cè)</legend><br>? ? ? ? 用&nbsp;戶&nbsp;名:<input type="text" name="uid">? ? ? ? <br><br>? ? ? ? 密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;碼:<input type="password" name="upwd" id="st3">? ? ? ? <br><br>? ? ? ? 確認(rèn)密碼:<input type="password" id="st4" name="upwd" onblur="check()">? ? ? ? <br><br>? ? ? ? <div id="XB">? ? ? ? 性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;別:<input type="radio" name="sex" checked="checked">男? ? ? ? <input type="radio" name="sex"/>女? ? ? ? </div>? ? ? ? <br>? ? ? ? 聯(lián)系電話:<input type="text" name="number">? ? ? ? <br><br>? ? ? ? 郵箱地址:<input type="email" name="mail" required="required" autofocus="autofocus">? ? ? ? <br><br>? ? ? ? <input type="submit" value="注冊(cè)" onclick="window.open('login.jsp','_self')">? ? ? ? &nbsp;&nbsp;&nbsp;? ? ? ? <input type="reset" value="重置">? ? ? ? &nbsp;&nbsp;&nbsp;? ? ? ? <input type="button" value="返回" onclick="window.open('login.jsp','_self')">? ? </fieldset></form><script>? ? function check() {? ? ? ? var? ? ? ? ? ? boo=$('st3').value==$('st4').value;? ? ? ? if(boo){? ? ? ? ? ? return true;? ? ? ? }else{? ? ? ? ? ? alert('兩次密碼不一樣')? ? ? ? }? ? }</script>? </body></html>注冊(cè)界面的beanpackage Bean;public class zhuceBean { private String uid; private String upwd; private String sex; private String number; private String mail; public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public String getUpwd() { return upwd; } public void setUpwd(String upwd) { this.upwd = upwd; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public String getMail() { return mail; } public void setMail(String mail) { this.mail = mail; } }注冊(cè)界面連接數(shù)據(jù)庫(kù)的代碼<%@ page language="java" import="java.util.*,java.sql.*" contentType="text/html; charset=UTF-8"%><%request.setCharacterEncoding("UTF-8"); %><jsp:useBean id="zhuce" class="Bean.zhuceBean"></jsp:useBean><jsp:setProperty property="*" name="zhuce"/><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>? <head>? ? <base href="<%=basePath%>">? ??? ? <title>三井體育</title>? ?? <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0">? ?? <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> -->? </head>??? <body>? ? <%? ? try{? ? Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");? ? String url = "jdbc:sqlserver://localhost:1433;DatabaseName=sanjin";? ? String username = "sa";? ? String password = "yjdi970822";? ? //創(chuàng)建數(shù)據(jù)庫(kù)連接? ? Connection conn = DriverManager.getConnection(url,username,password);? ? String sql = "insert into usertab(uid,upwd,sex,number,mail) values(?,?,?,?,?)";//添加信息語(yǔ)句? ? PreparedStatement ps = conn.prepareStatement(sql);? ? ps.setString(1,zhuce.getUid());? ? ps.setString(2,zhuce.getUpwd());? ? ps.setString(3,zhuce.getSex());? ? ps.setString(4,zhuce.getNumber());? ? ps.setString(5,zhuce.getMail());? ? int row = ps.executeUpdate();? ? if(row > 0){? ? ? ? out.print("注冊(cè)成功?。。?);?? ? }? ? ps.close();? ? conn.close();? ? }catch(Exception e){? ? ? ? out.print("注冊(cè)失?。。?!");? ? ? ? e.printStackTrace();? ? }? ? %>? </body></html>
查看完整描述

1 回答

?
蘇凝汐

TA貢獻(xiàn)5條經(jīng)驗(yàn) 獲得超0個(gè)贊

先把控制臺(tái)和頁(yè)面報(bào)錯(cuò)信息都貼一下啊。。

查看完整回答
反對(duì) 回復(fù) 2018-12-21
  • 1 回答
  • 0 關(guān)注
  • 743 瀏覽
慕課專欄
更多

添加回答

了解更多

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)