axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Android MD <android...@gmail.com>
Subject Re: server class
Date Wed, 06 Apr 2011 03:21:53 GMT
A ResultSet is a complex structure.. Anyway, it is a data tier related
object, which should not be exposed through the web service. Any data
retrieved from the database should be packaged into SIMPLE business domain
objects before being sent down the wire through the web service. So you
might have to redesign your app..

On Wed, Apr 6, 2011 at 6:15 AM, Deepal Jayasinghe <deepal@opensource.lk>wrote:

>  Yes, probably it is hard to serialize ResultSet. You need to use something
> like data services for this.
>
> Deepal
>
>
>  Hello,
>
> Can I not return Resultset as a return type from my Java class(Server.)
>
>
>
> I am getting error with following response.
>
>
>
>
>
> *-*<http://127.0.0.1:50669/wse/wsdl/soap_envelope_xml.jsp?soapEnvelopeType=1>
> <soapenv:Envelope xmlns:soapenv="*
> http://schemas.xmlsoap.org/soap/envelope/*">
>
> *-*<http://127.0.0.1:50669/wse/wsdl/soap_envelope_xml.jsp?soapEnvelopeType=1>
> <soapenv:Body>
>
> *-*<http://127.0.0.1:50669/wse/wsdl/soap_envelope_xml.jsp?soapEnvelopeType=1>
> <soapenv:Fault>
>
>   <faultcode>soapenv:Server</faultcode>
>
>   <faultstring>org.apache.axis2.AxisFault: Mapping qname not fond for the
> package: com.mysql.jdbc</faultstring>
>
>   <detail />
>
>   </soapenv:Fault>
>
>   </soapenv:Body>
>
>   </soapenv:Envelope>
>
>
>
> If yes please let me know:
>
>
>
>    Java Class I have commented code using ArrayList, ArrayList worked fine
> for me but I should not use it so:
>
> package sdsdd;
>
>
>
> import java.sql.*;
>
> import java.util.ArrayList;
>
> import java.util.List;
>
>
>
> public class add {
>
>
>
>                 public ResultSet res(String group){
>
>                                 Connection con;
>
>                                 List result = null;
>
>                                 String query;
>
>                                 ResultSet rs=null;
>
>                                 ArrayList<Object> arr=new
> ArrayList<Object>();
>
>                                                 try {
>
>
>
>
>
> Class.forName("com.mysql.jdbc.Driver");
>
> String url = "jdbc:mysql://localhost:3306/test";
>
> con = DriverManager.getConnection(url, "root", "abcd1234");
>
> Statement st = con.createStatement();
>
> query="select * from detail where group1='"+ group + "'";
>
> rs = st.executeQuery(query);
>
> ResultSetMetaData col=rs.getMetaData();
>
> int numCol=col.getColumnCount();
>
> System.out.println(numCol);
>
> while(rs.next())
>
>          {
>
> //ArrayList<Object> l=new ArrayList<Object>();
>
> //
>
> //
>
> //      l.add(rs.getInt(1));
>
> //      l.add(rs.getString(2));
>
> //      l.add(rs.getString(3));
>
> //
>
> //
>
> //
>
> //     arr.addAll(l);
>
>                 rs.getInt(1);
>
>          }
>
>
>
>
>
>
>
>                                                 } catch
> (ClassNotFoundException e) {
>
>                                                                 // TODO
> Auto-generated catch block
>
>
> e.printStackTrace();
>
>                                                 } catch (SQLException e) {
>
>                                                                 // TODO
> Auto-generated catch block
>
>
> e.printStackTrace();
>
>                                                 }
>
>                                                 return rs;
>
> }
>
>
>
> }
>
>
>
>
>
>
>
> If not which is the best possible way to return a  resultset.
>
>

Mime
View raw message