Home > front end >  Bosses, can you help me to change my 28 line, I don't know where is the wrong # JSP and databas
Bosses, can you help me to change my 28 line, I don't know where is the wrong # JSP and databas

Time:05-21

The first: "insert. The JSP file"



<% @ page language="Java" contentType="text/HTML. Charset=utf-8 "
PageEncoding="utf-8" % & gt;


<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "& gt;
Add the course & lt;/title> <br/></head> <br/><body> <br/><The form action="insertjudge. JSP & gt;" <br/><Table> <br/><The h2 & gt; Please input to add a course information: & lt;/h2 & gt; <br/><Tr> <br/><td> Course number: & lt;/td> <br/><td> <Input type="text" name="cno & gt;" </td> <br/></tr> <br/><Tr> <br/><td> Course name: & lt;/td> <br/><td> <Input type="text" name="cname" & gt; </td> <br/></tr> <br/><Tr> <br/><td> Course semester: & lt;/td> <br/><td> <Input type="text" name="cterm & gt;" </td> <br/></tr> <br/><Tr> <br/><td> Professional course: & lt;/td> <br/><td> <Input type="text" name="cmajor & gt;" </td> <br/></tr> <br/><Tr> <br/><td> School: & lt;/td> <br/><td> <Input type="text" name="chour & gt;" </td> <br/></tr> <br/><Tr> <br/><td> Credits: & lt;/td> <br/><td> <Input type="text" name="ccredit & gt;" </td> <br/></tr> <br/><Tr> <br/><td> Teacher: & lt;/td> <br/><td> <Input type="text" name="tno & gt;" </td> <br/></tr> <br/><Tr> <br/><td> Course introduction: & lt;/td> <br/><td> <Textarea name="cIntro" rows="3" cols="20" & gt; </textarea> </td> <br/></tr> <br/><Tr> <td> & nbsp; </td> <td> & nbsp; </td> </tr> <br/><Tr align="center" & gt; <br/><td> <Input type="submit" value="add https://bbs.csdn.net/topics/" name="submit" & gt; </td> <br/><td> <Input type="reset" value="https://bbs.csdn.net/topics/reset" name="reset" & gt; </td> <br/></tr> <br/></table> <br/></form> <br/></body> <br/></html> <br/><br/><br/><br/>The second page (jump) : "insertjudge. JSP <br/>"<br/><br/><br/><% @ page language="Java" contentType="text/HTML. Charset=utf-8 "<br/>PageEncoding="utf-8" % & gt; <br/><% @ page import="Java. SQL. *" % & gt; <br/><! PUBLIC DOCTYPE HTML "-////W3C DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" & gt; <br/><html> <br/><head> <br/><meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "& gt; <br/><title> Add data judgment & lt;/title> <br/></head> <br/><body> <br/><% <br/>Request. SetCharacterEncoding (" gb2312 "); <br/>String cno=request. The getParameter (cno ""); <br/>String cname=request. The getParameter (" cname "); <br/>String cterm=request. The getParameter (" cterm "); <br/>String cmajor=request. The getParameter (" cmajor "); <br/>String chour=request. The getParameter (" chour "); <br/>String ccredit=request. The getParameter (" ccredit "); <br/>String tno=request. The getParameter (" tnum "); <br/>String cintro=request. The getParameter (" cintro "); <br/>The String url="JDBC: mysql://localhost: 3306/SCMS?" + "useSSL=false& ServerTimezone=CST& CharacterEncoding=utf-8 ";//connection string <br/>String user="root"; <br/>String password="2001511 ty"; <br/>Class.forName("com.mysql.cj.jdbc.Driver");//the load driver <br/>The Connection conn=DriverManager. GetConnection (url, user, password);//create a connection to the database <br/>The Statement STMT=conn. CreateStatement ();//executing SQL statements <br/>String SQL="INSERT INTO course VALUES ('" + cno + "', '" + cname +"', '" + cterm + "', '" + cmajor + "', '" + chour + "', '" + ccredit + "', '" + tno + "', '" + cintro + ") "; <br/>Int I=STMT. ExecuteUpdate (SQL); <br/>If (I==1) {<br/>% & gt; <br/><The h2 & gt; Record add success & lt;/h2 & gt; <br/><%} <br/>The else {<br/>% & gt; <br/><The h2 & gt; Add failure record! </h2 & gt; <br/><%} <br/>STMT. Close (); <br/>Conn. Close (); <br/>% & gt; <br/></body> <br/></html> <br/><br/>The second file line 28 there is an error, don't know where is wrong: <img SRC="https://img.codepudding.com/202105/195262210112271.png" Alt=""/> <br/><br/><br/><br/>This is the database tables: <img SRC="https://img.codepudding.com/202105/195262210112272.png" Alt=""/> <img SRC=" https://img.codepudding.com/202105/195262210112273.png "Alt=" "/> </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/frontend/111798.html" target="_blank" style="color:#999">https//www.codepudding.com/frontend/111798.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/frontend/111797.html'>Append bootstrapTable (" append ", data) will reload the data.</a></div> <div class="detail-arr-right">Next:<a href='/frontend/111799.html'>Consult everybody, how can I get to the object!</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=JavaScript' target='_blank'>JavaScript</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul><li><a href="/frontend/111687.html">Iconfont commercial issues</a></li><li><a href="/Backend/111148.html">Qt software can be used in commercial software development, </a></li><li><a href="/Mobile/106172.html">For commercial real estate WeChat small program source code</a></li><li><a href="/other/100092.html">Whether you need Hexagon DSP SDK commercial license</a></li><li><a href="/other/70148.html">Excuse me docker can complete the simulation of a commercial</a></li><li><a href="/database/69880.html">Industrial and commercial bank of mysql database architectur</a></li><li><a href="/Mobile/61226.html">Small white weak q: use QT to develop commercial software is</a></li><li><a href="/os/49804.html">O: ubuntu installation pyqt5 tip is not compatible with the </a></li><li><a href="/Softwareengineering/43801.html">Graduation design for help! Commercial vehicle detection bas</a></li><li><a href="/database/38233.html">Pbntierbuilder product application solutions of commercial s</a></li> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>