JSP+SQLµÇ¼ע²áÒ³ÃæÒ»Ð©ÎÊÌâ
ÎÒµÄlogin.jsp¾ÍÊǼòµ¥µÄÏÖʵµÇÂ¼Ò³Ãæ£¬ÎÒµÄLoginGo.jspµÄ²¿·Ö´úÂëÈçÏ£º
<%@ page contentType="text/html; Charset=GB2312" language="java" import="java.sql.*,java.util.*,myPk.*" %>
<% Connection con;
Statement sql;
ResultSet rs;
String ID,Pwd,Figure;//µÇ¼Õ˺ţ¬ÃÜÂ룬µÇ¼Éí·Ý¼¶±ð
ID=request.getParameter("loginid");//loginidÊÇlogin.jspÖÐÕ˺ŵÄÎı¾¿òÃû×Ö
Pwd=request.getParameter("password");//passwordÊÇlogin.jspÖÐÃÜÂëµÄÃÜÂë¿òÃû×Ö
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){
out.print(e);
}
try
{
con=DriverManager.getConnection("jdbc:odbc:TestScore","","");
sql=con.createStatement();
rs=sql.executeQuery("select * from users where ID='"+ID+"' and Pwd='"+Pwd+"'");
if(rs.next()){
Figure=rs.getString("Figure");
session.setAttribute("Figure",Figure);
if(Figure.equals("ѧÉú")){
Ïà¹ØÎÊ´ð£º
ÎÒÓжà¸ö±íA B C ½á¹¹ÊÇÒ»ÑùµÄ£¬¶¼ÓÐ2¸ö×Ö¶ÎnameºÍcontent,ÎÒÒªËÑË÷ËùÒÔ±íËùÓÐ×Ö¶ÎÖаüº¬¡°Öйú¡±µÄÄÚÈÝ Õâ¸öSQLÓï¾äÔõôд
ÈçºÎ½«¶à¸ö±íµÄ²éѯ½á¹ûÁ¬³ÉÒ»¸ö±í Õâ¸öSQLÓï¾äÔõôд ±íµÄ½á¹¹ÊÇÒ»ÑùµÄ
ÀýÈç£ ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
ÎÒJSPµÄÒ³ÃæÊÇ£º
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle)
ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄǰ2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......