Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

´¿JSP·ÖÒ³´úÂëÖ®sqlserver2005/2008

ÉÏһƪ·ÖÒ³ÎÄÕ£¬ÊÇÓÃÓÚmysql£¬ÉÔ΢ÐÞ¸ÄÏ£¬ÓÃÓÚSqlserver2005/2008£¬Ã»ÓÐÒì³£´¦Àí¡£Ã»Óп¼ÂÇÐÔÄܵȡ£
ÏÖ½«´úÂëÌù³ö£¬ÒÔ¹©³õѧÕ߲ο¼£º
×¢£ºÑûÔÂʹÓû·¾³Eclipse 3.4.2+Tomcat 6.18+Sqlserver2005 sp3µ÷ÊԳɹ¦¡£
Ò³ÃæpagelistDemo.jspÄÚÈÝ£º
Code
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
    //Á¬½Ó×Ö·û´®
    String url = "jdbc:sqlserver://" + Globals.Server
            + ";databaseName=" + Globals.DbName;
    Class.forName(Globals.driverName).newInstance();
    Connection connection = DriverManager.getConnection(url,
            Globals.username, Globals.pwd);
    Statement statement = connection.createStatement();
    //ÿҳÏÔʾ¼Ç¼Êý
    int PageSize = 10;
    int StartRow = 0; //¿ªÊ¼ÏÔʾ¼Ç¼µÄ±àºÅ
    int PageNo = 0;//ÐèÒªÏÔʾµÄÒ³Êý
    int CounterStart = 0;//ÿҳҳÂëµÄ³õʼֵ
    int CounterEnd = 0;//ÏÔʾҳÂëµÄ×î´óÖµ
    int RecordCount = 0;//×ܼǼÊý;
    int MaxPage = 0;//×ÜÒ³Êý
    int PrevStart = 0;//Ç°Ò»Ò³
    int NextPage = 0;//ÏÂÒ»Ò³
    int LastRec = 0;
    int LastStartRecord = 0;//×îºóÒ»Ò³¿ªÊ¼ÏÔʾ¼Ç¼µÄ±àºÅ
    //»ñÈ¡ÐèÒªÏÔʾµÄÒ³Êý£¬ÓÉÓû§Ìá½»
    if (request.getParameter("PageNo") == null) {&n


Ïà¹ØÎĵµ£º

JSP/ServletµÄURLÖض¨Ïò

1.RequestDispatcher.forward() 
ÊÇÔÚ·þÎñÆ÷¶ËÆð×÷ÓÃ,µ±Ê¹ÓÃforward()ʱ,Servlet engine´«µÝHTTPÇëÇó´Óµ±Ç°µÄServlet or JSPµ½ÁíÍâÒ»¸öServlet,JSP »òÆÕͨHTMLÎļþ,Ò²¼´ÄãµÄformÌá½»ÖÁa.jsp,ÔÚa.jspÓõ½ÁËforward()Öض¨ÏòÖÁb.jsp,´ËʱformÌá½»µÄËùÓÐÐÅÏ¢ÔÚb.jsp¶¼¿ÉÒÔ»ñµÃ,²ÎÊý×Ô¶¯´«µÝ. 
µ«forward()ÎÞ·¨Öض ......

SQLServerÖÐDatetimeÀàÐÍÊý¾ÝµÄ±È½Ï

SQLServerÖÐDatetimeÀàÐÍÊý¾ÝµÄ±È½Ï
2009Äê02ÔÂ20ÈÕ ÐÇÆÚÎå 16:40
 
 
/* ¶¨Ò忪ʼÈÕÆںͽáÊøÈÕÆÚ*/
declare @date_a datetime,@date_b datetime
set @date_a='2009-2-10'
set @date_b='2009-2-12'
/* ÔÚÈÕÆÚdate_a(°üº¬) ºÍdate_b(²»°üº¬) Ö®¼ä*/
select * from ut_article where createtime between @ ......

jspѧϰ±Ê¼Ç2

JSPµÄ×¢ÊÍ
<%--........--%>
JSPÖ¸ÁîºÍJSP¶¯×÷£¨±ê×¼µÄJSP±êÇ©£©
JSPÖ¸ÁîµÄÓï·¨
<%@... ....%>
<%@include file="...."%> °üº¬Ö¸Á°üº¬Ö¸Áî»á½«Òª°üº¬µÄÎļþ´úÂëÔ­ÑùÊä³öµ½±¾Ò³Ã棨ÔÚ·­Òëʱ°Ñ°üº¬ÎļþµÄÄÚÈÝÒýÈë²¢ºÏ²¢£©£¬²»½øÐз­Ò룬fileÊôÐÔÖƶ¨Òª°üº¬µÄÎļþµÄÃû×Ö£¨×¢ÒâÒª°üº¬µÄÎļþµÄ·¾¶£©£ ......

jspѧϰ±Ê¼Ç4

JSP×Ô¶¨Òå±êÇ©£¨tag£©
ʲôÊÇ×Ô¶¨Òå±êÇ©
1£¬Óû§×Ô¶¨ÒåµÄJavaÓïÑÔÔªËØ, ʵÖÊÊÇÔËÐÐÒ»¸ö»òÕßÁ½¸ö½Ó¿ÚµÄJavaBean;
2£¬¿ÉÒԷdz£»úÃܵغÍJSPµÄ±íʾÂß¼­ÁªÏµÔÚÒ»Æð£¬ÓÖ¾ßÓкÍÆÕͨJavaBeanÏàͬµÄÒµÎñÂß¼­´¦ÀíÄÜÁ¦;
3£¬µ±Ò»¸öJSPÒ³Ãæת±äΪservletʱ£¬Æä¼äµÄÓû§×Ô¶¨Òå±êǩת»¯Îª²Ù×÷Ò»¸ö³ÆΪ±êÇ©handerµÄ¶ÔÏó;
4£¬¿É²Ù×÷ĬÈÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ