Hi friends,
I am jayapradeep,
I create
java class file which contain method
public ArrayList getStockDetail(String cname,String symbol ) ,after that i create WSDL file for that class(Stock).In
client side i can not received the return value.so i change the return type as String .
Can you explain for if any alternate for ArrayList,
except String return type. Example code:
public class Stock
{
public ArrayList getStockDetail(String cname,String symbol ) throws Exception
{
ArrayList theResultList = new ArrayList();
Connection aCon = null;
PreparedStatement aPS = null;
ResultSet aRS = null;
StringBuffer stockQuery = new StringBuffer( "" );
stockQuery.append( " SELECT " );
stockQuery.append( " CNAME, " );
stockQuery.append( " CSYSMBOL, " );
stockQuery.append( " MARKETTYPE, " );
stockQuery.append( " CADDRESS, ");
stockQuery.append( " QUOTES_LAST, ");
stockQuery.append( " QUOTES_WH, " );
stockQuery.append( " QUOTES_WL, " );
stockQuery.append( " QUOTES_MC ");
stockQuery.append( " FROM STOCK " );
stockQuery.append( " WHERE CNAME LIKE ? " );
stockQuery.append( " OR CSYSMBOL Like ? " );
System.out.println("---------------------");
System.out.println(stockQuery);
System.out.println("---------------------");
try
{
aCon = ConnectionConf.getConnection();
aPS = aCon.prepareStatement( stockQuery.toString() );
aPS.setString( 1, cname );
aPS.setString( 2, symbol.toUpperCase() );
HashMap htTemp = null;
for( aRS = aPS.executeQuery(); aRS.next(); theResultList.add(htTemp) )
{
htTemp = new HashMap();
htTemp.put( "CNAME" , aRS.getString( "CNAME" ) );
htTemp.put( "CSYSMBOL" , aRS.getString( "CSYSMBOL" ) );
htTemp.put( "MARKETTYPE" , aRS.getString( "MARKETTYPE" ) );
htTemp.put( "CADDRESS" , aRS.getString( "CADDRESS" ) );
htTemp.put( "QUOTES_LAST" , aRS.getString( "QUOTES_LAST" ) );
htTemp.put( "QUOTES_WH" , aRS.getString( "QUOTES_WH" ) );
htTemp.put( "QUOTES_WL" , aRS.getString( "QUOTES_WL" ) );
htTemp.put( "QUOTES_MC" , aRS.getString( "QUOTES_MC" ) );
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
aCon.close();
aRS.close();
}
return theResultList;
}
}