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
相关文档:
/**
* Base64Util for Java
* cheungmine
* 2009-11-8
*/
public class Base64Util {
/**
* @param args
*/
public static void main(String[] args)
{
// 源字节数组
int cb = 0;
System.out.print("源字节数组: ");
byte in[] = new byte[100];
in[cb++]='1';
i ......
话题是由如下的事情引出的: public class StringTest { public static void main(String[] args) { String str1 = new String("abc"); String str2 = "abc"; if (str1 == str2) { ......
在应用程序中我们经常需要一个类去完成像数据处理、监听事件或检查另一个类的活动等任务。为了达到这个目标,我们可能使用带有一套锁和消息通知的线程。Java 线程API已经很好的文档化,但为了使线程能够正确而高效地运行,程序员仍然需要丰富的编程经验并编写大量的代码。通过应用本篇文章中讨论的框架,程序员能够避 ......
1. 对于一个static方法而言,无法访问泛型类的类型参数,所以,如果static方法需要使用泛型能力,就必须使其成为泛型方法。
2. 当使用泛型类时,必须在创建对象的时候制定类型参数的值,而是用泛型方法的时候,通常不必指定参数类型,因为编译器会为我们找出具体的类型。这称为类型参数推断。 ......
预备知识
本教程针对使用过 Rational ClearQuest Test Management 的人员。需要你了解 CQTM 中的基本概念。另外你最好了解 Eclipse,但不是必需的。
系统需求
您可以安装 IBM WebSphere Integration Developer 来运行本文中的示例程序。
Rational ClearQuest Test Manager(CQTM)简介
目 ......