ʹÓÃjava ¼àÌýÆ÷ʵÏÖÔÚÏßÈËÊýͳ¼Æ
1£® ÔÚ¹¤³ÌÖд´½¨¼àÌýÀàSessionListener ²¢ÇÒʵÏÖHttpSessionListener½Ó¿Ú£¬´úÂëÈçÏÂ
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
public class SessionListener implements HttpSessionListener {
private static int count = 0;
public void sessionCreated(HttpSessionEvent se) {
count++;
System.out.println("session´´½¨£º" + new java.util.Date());
}
public void sessionDestroyed(HttpSessionEvent se) {
count--;
System.out.println("sessionÏú»Ù£º" + new java.util.Date());
}
public static int getCount() {
return count;
}
}
2£® ÅäÖÃweb.xml
<listener>
<description>session¼àÌýÆ÷</description>
<listener-class>com.xxx.SessionListener</listener-class>
</listener>
3£® ÔÚJSPÒ³ÃæÖÐÏÔʾÔÚÏßÈËÊý
<%
int count=com.xxx.SessionListener.getCount();
out.println("ÔÚÏßÈËÊý£º"+count);
%>
×¢Ò⣺servletÖжÔsessionµÄ¼àÌýÓкܶà½Ó¿Ú£¬¹¦ÄܺÜÁé»î£¬×î³£ÓõÄÊǼàÌýSessionºÍAttribute¡£ÕâÀïÒª³ÎÇåһϸÅÄservletÖеÄsession¼àÌýºÍAttribute¼àÌýº¬ÒåÓвî±ð£¬session¼àÌýÖ¸µÄ²»ÊÇÎÒÃÇÒ»°ãËùÀí½âµÄ·ÅÖÃÒ»¸ösession»òÕßÏú»ÙÒ»¸ösession£¬ÕâÊÇAttribute¼àÌýµÄ¹¦ÄÜ£¬ÒòΪservletÖзÅÖÃsessionµÄÓï·¨ÊÇsession.setAttribute(“sessionÃû”,Òª·ÅÈëµÄ¶ÔÏó)¡£¶øsession¼àÌý£¬¼àÌýµÄÊÇHTTPÁ¬½Ó£¬Ö»ÒªÓÐÓû§ÓëserverÁ¬½Ó£¬¾ÍËãÁ¬½ÓµÄÊÇÒ»¸ö¿Õ°×µÄjspÒ³Ã棬Ҳ»á´¥·¢sessionʼþ£¬ËùÒÔ´Ë´¦µÄsessionʵ¼ÊÉÏÖ¸µÄÊÇconnection£¬ÓÃÀ´Í³¼Æµ±Ç°ÔÚÏßÓû§Êý
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
l JBS
1.Áоٳö 10¸öJAVAÓïÑÔµÄÓÅÊÆ
a:Ãâ·Ñ£¬¿ªÔ´£¬¿çƽ̨(ƽ̨¶ÀÁ¢ÐÔ)£¬¼òµ¥Ò×Ó㬹¦ÄÜÍêÉÆ£¬ÃæÏò¶ÔÏ󣬽¡×³ÐÔ£¬¶àỊ̈߳¬½á¹¹ÖÐÁ¢£¬ÆóÒµÓ¦ÓõijÉÊìƽ̨, ÎÞÏßÓ¦ÓÃ
2.ÁоٳöJAVAÖÐ10¸öÃæÏò¶ÔÏó±à³ÌµÄÊõÓï
a:°ü£¬À࣬½Ó¿Ú£¬¶ÔÏó£¬ÊôÐÔ£¬·½·¨£¬¹¹ÔìÆ÷£¬¼Ì³Ð£¬·â×°£¬¶à̬£¬³éÏ󣬷¶ÐÍ
3.ÁоٳöJAVAÖÐ6¸ ......
·½·¨ÖØÔØ(overloading method)
·½·¨ÖØÔØÊÇÈÃÀàÒÔͳһµÄ·½Ê½´¦Àí²»Í¬ÀàÐÍÊý¾ÝµÄÒ»ÖÖÊֶΡ£JavaµÄ·½·¨ÖØÔØ£¬¾ÍÊÇÔÚÀàÖпÉÒÔ´´½¨¶à¸ö·½·¨£¬ËüÃǾßÓÐÏàͬµÄÃû×Ö£¬µ«¾ßÓв»Í¬µÄ²ÎÊýºÍ²»Í¬µÄ¶¨Òå¡£µ÷Ó÷½·¨Ê±Í¨¹ý´«µÝ¸øËüÃǵIJ»Í¬¸öÊýºÍÀàÐ͵IJÎÊýÀ´¾ö¶¨¾ßÌåʹÓÃÄĸö·½·¨, Õâ¾ÍÊǶà̬ÐÔ¡£ ......
Ò»£ºÎÞ·µ»ØÖµµÄ´æ´¢¹ý³Ì
´æ´¢¹ý³ÌΪ£º
CREATE OR REPLACE PROCEDURE TESTA(PARA1 IN VARCHAR2,PARA2 IN VARCHAR2) AS
BEGIN
INSERT INTO HYQ.B_ID (I_ID,I_NAME) VALUES (PARA1, PARA2);
END TESTA;
È»ºóÄØ£¬ÔÚjavaÀïµ÷ÓÃʱ¾ÍÓÃÏÂÃæµÄ´úÂ룺
package com.hyq.src;
import java.sql.*;
import j ......
Ò»ÖÖÊǼ̳Ð×ÔThreadÀà.Thread ÀàÊÇÒ»¸ö¾ßÌåµÄÀ࣬¼´²»ÊdzéÏóÀ࣬¸ÃÀà·â×°ÁËÏ̵߳ÄÐÐΪ¡£Òª´´½¨Ò»¸öỊ̈߳¬³ÌÐòÔ±±ØÐë´´½¨Ò»¸ö´Ó Thread Àർ³öµÄÐÂÀà¡£³ÌÐòԱͨ¹ý¸²¸Ç Thread µÄ run() º¯ÊýÀ´Íê³ÉÓÐÓõŤ×÷¡£Óû§²¢²»Ö±½Óµ÷Óô˺¯Êý£»¶øÊÇͨ¹ýµ÷Óà Thread µÄ start() º¯Êý£¬¸Ãº¯ÊýÔÙµ÷Óà run()¡£
&nb ......