Çó½ÌÒ»¸öÈëÃż¶µÄjspÎÊÌâ - Java / Web ¿ª·¢
ÎÒµÄÊý¾Ý¿âÁ¬½ÓÎÊÌ⣬µ«Ö´ÐÐÒ»¸öÊéÉϵijÌÐòʱ×ÜÊDZ¨´í£¬¸÷λ´óÏÀ°ïæ´¦ÀíÏÂ
´úÂëÈçÏ£º
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>²éѯϵͳ</title>
</head>
<body>
<%
String dbDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver";
//»ñµÃÓû§µÄÊäÈëÐÕÃû
String studentname=new String(request.getParameter("studentname").getBytes("iso8859-1"),"GB2312");
//ÉèÖÃÊý¾Ý¿âµÄurl£¬databasename±íʾÊý¾Ý¿âÃû³Æ
String url="jdbc:sqlserver://localhost:1433;DatabaseName=test";
String user="sa";
String pwd="123456";
String query="select * from student where Stu_Name like '% "+studentname+" %' ";
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
try{
//¼ÓÔز¢×¢²ájdbcÇý¶¯
Class.forName(dbDriver);
conn= DriverManager.getConnection(url,user,pwd);
stmt=conn.createStatement();
rs=stmt.execute
Ïà¹ØÎÊ´ð£º
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ã潫²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......
ÔõôÑù½«id´«¹ýÈ¥°¡£¿£¿£¿ÊǼòµ¥µÄ´«¡£¡£¡£ÔÚµØÖ·À¸ÖÐдidºÅ
LZ ºÃÓÄĬ£¡²»ÖªµÀÄãµÄÒâ˼£¿
ÊÇÏë°ÑID ´«µ½ACTION ? ͨ¹ýURl id=?
²»¹»Ïêϸ ±ðÈ˲»ÖªµÀÔõÑù°ïÄã
../XXXXX.do?id=XXXX&id2=XXXXX
......
id name datetime
1 a 2010-05-13 10:15:00
2 b 2010-05-14 09:10:00
3 d 2010-05-14 10:10:00
ÈçºÎ½«¾àÀëÄ¿Ç°×î½üµÄÄǸö¼Ç¼µÄname ¸üÐÂΪ¡°x¡±ÄØ
лл¿© °¡ ºÇºÇ
update table_n ......
ÏÖÔÚ²»ÏëÓÃ<a> </a> ±êÇ© £¬ÒòΪµã»÷ºó»á³öÏÖÒ³ÃæÖض¨Î»£¬¸øÎÄ×Ö¼ÓÉÏcssÑùʽ¾Í¿ÉÒÔ¿´ÆðÀ´ ÊÇhrefÔõôʵÏÖÕâÑùµÄcss
text-decoration:underline; cursor:hand;
ÒýÓÃ
text-decoration:underline; cur ......