Axis2 java WebServices¿ª·¢ÈýPOJO
»·¾³JDK1.5
Eclipse 3.2
Ö±½ÓÉÏ´úÂ룺Èç¹ûûÓÐÅäÖúû·¾³Çë²Î¿´Ç°Á½ÆªÈÕÖ¾
·þÎñÆ÷¶Ë´úÂë
UserÀࣺ
/*
*Class User.java
*Create Date: 2009-11-4
*Author:a276202460
*/
package com.axis.pojo.test;
public class User implements java.io.Serializable{
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj instanceof User) {
User user = (User) obj;
if (user.getUserid() == this.getUserid()) {
return true;
}
}
return false;
}
public String toString() {
return (username == null ? "" : username) + " "
+ (sex == null ? "" : sex) + " " + age + "Ëê";
}
public User(){
}
int userid;
String username;
int age;
String sex;
public User(int userid, String username, int age, String sex) {
this.setUserid(userid);
this.setUsername(username);
this.setAge(age);
this.setSex(sex);
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
UserDAO
/*
*Class UserDAO.java
*Create Date: 2009-11-4
*Author:a276202460
*/
package com.axis.pojo.test.dao;
import java.util.List;
import com.axis.pojo.test.User;
public interface UserDAO {
public String addUser(User user) throws java.rmi.RemoteException;
public User getUser(int userid) throws java.rmi.RemoteException;
public String deleteUser(User user) throws java.rmi.RemoteException ;
public String updateUser(User user) throws java.rmi.RemoteException ;
public List getAllUser() throws java.rmi.RemoteException;
}
´ËÀàÖеÄËùÓз½·¨¶¼¼ÓÁË·µ»ØÖµ£¬ÒòΪÔÚÅ׳öÒì³£µÄʱºòÎÒµ÷ÊԵĴúÂë·¢ÉúÒì³£java.lan
Ïà¹ØÎĵµ£º
»°ÌâÊÇÓÉÈçϵÄÊÂÇéÒý³öµÄ£º public class StringTest { public static void main(String[] args) { String str1 = new String("abc"); String str2 = "abc"; if (str1 == str2) { ......
ºÜ¶àdeveloperÖªµÀjavaÒ²¿ÉÄÜmemory leak£¬¹ØÓÚÕâ¸öÖ÷ÌâÒѾÓкܶàÎÄÕÂÁË¡£ÎÒÕâÀïÖ»Ïë·ÖÏíÒ»ÏÂ×Ô¼ºµÄmemory leakµÄ¾Ñé¡£
˵Ã÷Ò»ÏÂÕâÀïÖ¸µÄmemory leakÊdzÌÐò²»¼°Ê±ÊÍ·Åheapµ¼ÖµÄOutOfMemoryError.
Ê×ÏÈÒ»ÖÖÇé¿öÊÇcollection»òÕßÊÇmapÒ»Ö±±»putÊý¾Ý£¬Ã»Óлú»áremove£¬µ¼ÖÂOutOfMemoryError¡£ÓÈÆäÊǵ±collection»òÕßÊÇmap ......
javax.servlet.http.HttpSession Õâ¸öÀàÊǺܳ£Óõģ¬Ã¿µ±ÎÒÃÇä¯ÀÀÍøÕ¾£¬²»ÂÛÓÐûÓеǽ£¬¶¼»á²úÉú1¸ösession£¬Ëü¼Ç¼Á˺Íä¯ÀÀÕßÏà¹ØµÄÊý¾Ý£»
ÏÂÃæ½éÉÜsessionµÄ2¸ö¼àÌýÆ÷½Ó¿Ú£º
1£©javax.servlet.http.HttpSessionBindingListener;
ʵÏÖÕâ¸ö½Ó¿ÚµÄÀ࣬ÿµ±±»´æ·Åµ½session»ò´ÓsessionÖÐÒƳý¶¼»á³ö·¢½Ó¿ÚÖÐÏàÓ¦µ ......
ÔÚijЩӦÓÃÖУ¬½«±¾¸ÃÓɶ¯Ì¬Ò³Ãæÿ´Î»ñÈ¡¿Í»§¶ËÇëÇóʱȥµ÷ÓÃÊý¾ÝµÄ¹ý³Ìת»»ÎªÔÚÌí¼ÓÊý¾Ýʱ¼´Éú³ÉΪ¾²Ì¬Ò³Ã棬ÕâÑù¶Ô·þÎñÆ÷µÄѹÁ¦£¬Êý¾Ý¿â¼ìË÷µÄѹÁ¦£¬ÒÔ¼°ËÑË÷ÒýÇæÊÕ¼£¬°üÀ¨·ÀÖ¹SQL×¢È붼ÊÇÓм«´óµÄºÃ´¦µÄ¡£³£¼ûµÄ×ö·¨ÓкܶàÖÖ£¬°üÀ¨web·þÎñÆ÷ÆôÓÃrewrite£¬io²Ù×÷Éú³ÉÎļþµÈµÈ£¬ÕâÀï ......
1. Õ»(stack)Óë¶Ñ(heap)¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
¡¡¡¡2. Õ»µÄÓÅÊÆÊÇ£¬´æÈ¡ËٶȱȶÑÒª¿ì£¬½ö´ÎÓÚÖ±½ÓλÓÚCPUÖеļĴæÆ÷¡£µ«È±µãÊÇ£¬´æÔÚÕ»ÖеÄÊý¾Ý´óСÓëÉú´æÆÚ±ØÐëÊÇÈ·¶¨µÄ£¬È±·¦Áé»îÐÔ¡£ÁíÍ⣬ջÊý¾Ý¿ÉÒÔ¹ ......