axis2遭遇对象数组传递问题,请达人指点

[复制链接]
查看11 | 回复0 | 2007-7-16 11:48:00 | 显示全部楼层 |阅读模式
package sample.pojo.rpcclient;
import sample.pojo.data.DAO;
import java.sql.*;
import java.util.ArrayList;
import javax.xml.namespace.QName;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
public class serviceTest {


private static ArrayList array=new ArrayList();


/*

* This sample shows how to list all the names from the EMP table

* It uses the JDBC THIN driver. See the same program in the

* oci8 samples directory to see how to use the other drivers.

*/
/*
* Connect to the database
* You must put a database name after the @ sign in the connection URL.
* You can use either the fully specified SQL*net syntax or a short cut
* syntax as ::. The example uses the short cut syntax.
*/


private static Connection getConnection() throws Exception
{
try{

Class.forName("oracle.jdbc.driver.OracleDriver");

}catch(Exception e){

System.out.println("No Driver!");

}

String url = "jdbc:oracle:thin:@127.0.0.1:1521:xe";

String userName = "compiere";

String password = "compiere";

Connection conn =DriverManager.getConnection (url, userName, password);

return conn;
}
private static DAO Daoimp(ResultSet rs) throws Exception
{

DAO dao=new DAO();

dao.setC_BPARTNER_ID(rs.getInt("C_BPARTNER_ID"));

dao.setAD_CLIENT_ID(rs.getInt("AD_CLIENT_ID"));

dao.setAD_ORG_ID(rs.getInt("AD_ORG_ID"));

dao.setISACTIVE(rs.getString("ISACTIVE").charAt(0));

dao.setCREATED(rs.getDate("CREATED"));

dao.setCREATEDBY(rs.getInt("CREATEDBY"));

dao.setUPDATED(rs.getDate("UPDATED"));

dao.setUPDATEDBY(rs.getInt("UPDATEDBY"));

dao.setVALUE(rs.getString("VALUE"));

dao.setNAME(rs.getString("NAME"));

dao.setNAME2(rs.getString("NAME2"));

dao.setDESCRIPTION(rs.getString("DESCRIPTION"));

dao.setISSUMMARY(rs.getString("ISSUMMARY").charAt(0));

return dao;


}
public static void main (String args []) throws Exception
{
//Load the Oracle JDBC driver
Connection conn=getConnection();
// Create a Statement

Statement stmt = conn.createStatement ();

ResultSet rs = stmt.executeQuery ("select * from CU_Frank");

//ResultSetMetaData rsmd = rs.getMetaData();

//int numberOfColumns = rsmd.getColumnCount();
//
output the resultset

while (rs.next ())

{

array.add(Daoimp(rs));

/*for(int i=1;i复制代码
发布的webservice中的函数
public void setList(Object[] _obs)
{

obs=_obs;
}
复制代码
数组中只有一个对象的时候,服务器可以接受,但是超过一个对象,就会出现数组越界错误,不知道为什么,有没有高人指点下,或者给段程序小弟参考下。
邮箱:[email protected]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行