´¿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
Ïà¹ØÎĵµ£º
<%
int a =1;
out.println("<input type='checkbox' value='"+a+"'>");
%>
<%int b =1 ;%>
<i ......
Java´úÂ룺
package com.zhaipuhong.common.util;
import java.util.ArrayList;
import org.apache.log4j.Logger;
import javax.servlet.http.HttpServletRequest;
public class PageBean { & ......
´ËʵÏÖ¹²·ÖÈý¸öÎļþ£¬¼´£ºCreatImage.java Éú³ÉͼÏñÁ÷µÄÀ࣬ÌṩÓÃÓÚÉú³ÉͼƬÁ÷µÄ·½·¨£»images.jsp ͼƬ°ü×°£¬ÓÃÓÚ½«Í¼Æ¬¼ÓÈëµ½responseÊä³öÁ÷ÖУ»login.jsp µ÷ÓÃÇ°ÃæµÄjsp£¬ÏÔʾÑéÖ¤Âë¡£
CreatImage.java Àࣺ
3 import java.awt.Color;
4 import java.awt.Font;
5 import java.awt.Graphics;
6 im ......
1£©Ð½¨Êý¾Ý¿âRESTORE
2£©ÔÚ¸ÃÊý¾Ý¿âÉÏÑ¡Ôñ£ºÈÎÎñ->»¹Ô->Êý¾Ý¿â
3£©ÔÚ»¹ÔÊý¾Ý¿â-RESTOREµÄ¶Ô»°¿òÖÐ
Ä¿±êÊý¾Ý¿âÊÇRESTORE
Ö¸¶¨ÓÃÓÚ»¹ÔµÄ±¸·Ý¼¯µÄÔ´ºÍλÖÃ->Ô´É豸->Ñ¡Ôñ×îºóÒ»¸öÍêÈ«µÄ±¸·ÝBAKÎļþ
¹´Öл¹ÔCheckBox
4£©Ñ¡Ôñ×óÉϽǵÄÑ¡Ïî
ÔÚ»¹ÔÑ ......
JSPµÄ×¢ÊÍ
<%--........--%>
JSPÖ¸ÁîºÍJSP¶¯×÷£¨±ê×¼µÄJSP±êÇ©£©
JSPÖ¸ÁîµÄÓï·¨
<%@... ....%>
<%@include file="...."%> °üº¬Ö¸Á°üº¬Ö¸Áî»á½«Òª°üº¬µÄÎļþ´úÂëÔÑùÊä³öµ½±¾Ò³Ã棨ÔÚ·Òëʱ°Ñ°üº¬ÎļþµÄÄÚÈÝÒýÈë²¢ºÏ²¢£©£¬²»½øÐзÒ룬fileÊôÐÔÖÆ¶¨Òª°üº¬µÄÎļþµÄÃû×Ö£¨×¢ÒâÒª°üº¬µÄÎļþµÄ·¾¶£©£ ......