jsp—MySqlÖÆ×÷B/sµÇ½µÄºÃÀý×Ó Ñ§Ï°±Ê¼Ç
½¨Á¢Ìõ¼þÊ×ÏÈÒ»¶¨ÒªÈ·¶¨×Ô¼ºµÄmysql£¬tomcat,eclipseÁ¬½ÓÊÇÕýÈ·µÄ¡£
index.jspºÜ¼òµ¥£¬¾ÍÒ»¸öÌøת¡£
<%
response.sendRedirect("lg.jsp");
%>
lg.jsp ʵÏֵǼ¿ò¼Ü
<%@ page contentType="text/html; charset=utf-8" %>
<html>
<head>
<title>
login
</title>
</head>
<center>
Prease input UserName and Pssword!!
</center>
<body bgcolor="#ffffff">
<%String flag=request.getParameter("flag");
if(flag!=null&&flag.equals("0")){
out.println("Pls input valid username and password!<br><br>");
}
%>
<form name="form1" method="post" action="login.jsp">
<center>
<input name="UserName" type="text" ><br/>
<input name="Password" type="password"><br/>
<input name="submit" type="submit" value="submit">
<input name="reset" type="reset" value="reset">
</center>
</form>
</body>
</html>
login.jsp Îļþ
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<head>
<title>Óû§µÇ½</title>
</head>
<body>
<%
String UserName=request.getParameter("UserName");
String Password=request.getParameter("Password");
ResultSet rs=null;
Statement stmt=null;
Connection con=null;
boolean flag=false;
try{
//Çý¶¯³ÌÐòÃû
String driverName="com.mysql.jdbc.Driver";
//Êý¾Ý¿âÓû§Ãû
String userName="test";
//ÃÜÂë
String userPasswd="123456";
//Êý¾Ý¿âÃû
String dbName="along";
//±íÃû
String tableName="user";
String url="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPasswd;
Class.forName("com.mysql.jdbc.Driver").newInstance();
con=DriverManager.getConnection(url);
stmt = con.createStatement();
String sql="select * from user where UserName='"+UserName+"' and Password='"+Password+"'";
System.out.println("login: "+sql);
rs = stmt.executeQuery(sql);
//System.out.printl
Ïà¹ØÎĵµ£º
Á½ÄêÇ°£¬ÔøÓÐһλǰ±²¶ÔÎÒ˵¹ý£º¿ª·¢Ò»¸öÊôÓÚÄã×Ô¼ºµÄÍøÕ¾£¬È»ºóÿÌ컨һµã¿ÕÏеÄʱ¼äÈ¥¾ÓªÒ»Ï£¬ÖÕÓÐÒ»Ì죬Äã»á·¢¾õËüÊǷdz£ÓÐÓõġ£¸Õ¿ªÊ¼µÄʱºò£¬ÎÒûÓаÑÕâЩ»°·ÅÔÚÐÄÉÏ£¬ÂýÂýµØ£¬ÎҲŷ¢¾õÕâλǰ±²ËµµÄ»°ÊǺÜÓеÀÀíµÄ¡£¼ÙÉèÁ½ÄêÇ°¿ªÊ¼¾ÓªÒ»¸öÍøÕ¾£¬Í¨¹ýÕâÁ½ÄêµÄÍƹãºÍÔËÓª£¬Ëµ²»¶¨µ½Ï ......
ÄãµÄ¿ì½Ý½¨ÉèÖÃÓÐÎÊÌ⣬ÄãÖØÐÂÉèÖÃÒ»ÏÂÔÚ window --> Perferences--> General--> keys
½«Content Assist¿ì½Ý¼üÉèÖóÉAlt + /¾Í¿ÉÒÔÁË
Èç¹ûÄã·¢ÏÖµãÁËApply¹ØÁËÖ®ºó£¬Ôٴδò¿ªContent AssistµÄ¿ì½Ý¼üûÓиıäµÄ»°£¬ÄÇÊÇÒòΪÏÂÃæÓÐÒ»¸öÑ¡ÏîÒѾÓõ½ÁËAlt + /£¬¾ßÌåÊÇÄÄÒ»¸öÎҼDz»ÇåÁË£¬Äã°ÑÄǸöcommandµÄ¿ì½Ý¼ü¸ ......
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Author" content="Jiang Hongbin">
<title>ÈÕÆÚÑ¡Ôñ - BY ziyue</title>
<script language="JavaScript" type="text/JavaScript">
// ÈÕÆÚÑ¡Ôñ
var months = new Array ......
<body style="height:100%;">
-------------------------------------------------------------------Ò»¿ªÊ¼µÄÒ³Ãæ----------------------
fdasfsdfadf
<input name="button2" onclick="ShopConfirm('fdsaf')" value="µãÎÒ" type="button"/>
--------------------------------------------------------- ......
jspʹÓÃ×é¼þ½øÐÐÎļþÉÏ´«
WEBÎļþÉÏ´«¿ÉÄÜÊÇÍøÕ¾½¨ÉèÖÐ×î³£ÓõŦÄÜÖ®Ò»£¬ÎÒÔÚÏîÄ¿¿ª·¢Öм¸ºõ¶¼ÐèҪʵÏÖÎļþÉÏ´«¹¦ÄÜ£®Ç°¶Îʱ¼ä×Ô¼ºËѼ¯ÁËһЩÉÏ´«×é¼þ£®ÕâƪÎÄÕÂÖн«½éÉÜÕâЩ×é¼þµÄʹÓ÷½·¨£¬²¢ÇұȽϸ÷×ÔµÄÓÅÁÓ£®
Ò»£¬smartupload×é¼þ£®
ÎÒÏëÖ»Òª×ö¸öÎļþÉÏ´«µÄÅóÓѶ¼ÖªµÀÕâ¸ö×é¼þ£¬ÎÒÈÏʶµÄÈËÖÐʹÓÃ×î¶àµÄÒ²ÊÇËü£¡ÎÒ¸ ......