Rubbish.

There is no reason you can't return a ResultSet. Serialization has nothing
to do with it.

The ResultsSet *does* have to be valid, though. See my previous post.

--
Martin Cooper
Tumbleweed Communications

----- Original Message -----
From: "sanjeev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 21, 2000 6:53 AM
Subject: Re: Database access in JSP...


> Hi Roberto,
>
>         You can't return a ResultSet object from a bean to a JSP page 'cuz
it is
> not serializable. One thing you can do is, Just copy the contents into a
Vector
> (You can use Vector of Vectors if u have more than one rows in ur
resultset) and
> return that vector to your JSP page.
>
> Hope I understood your problem
> Sanjeev.
>
> "Robuschi (Delfi)" wrote:
>
> > Hello everybody!!!!!!!
> >
> > I'm trying to return a resultset from a Javabean but it doesn't work. So
I
> > send you the code, hoping that someone can solve my problem.
> >
> > XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> > JAVABEAN:
> > public class provabean  {
> >
> >   public ResultSet Esegui(int numero) {
> >   try
> >   {
> >  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> >  Connection con = DriverManager.getConnection("jdbc:odbc:wds","sa","");
> >  CallableStatement cs = con.prepareCall( "{call pippo(?)}");
> >  cs.clearParameters();
> >  cs.setInt(1,numero);
> >  System.out.println("Ciao6");
> >  ResultSet rs = cs.executeQuery();
> >  return rs;
> >   } catch (Exception E) {
> >    System.out.println("Errore : "+E.getMessage());
> >    return null;
> >   }
> >
> > }
> > XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
> > JSP PAGE:
> > <jsp:useBean id="prova" class="provabean" />
> > <HTML>
> > <HEAD>
> > <TITLE>ELENCO OGGETTI PER PADRE
> > <%
> >  import java.sql.*;
> >  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> > %>
> > </TITLE>
> > </HEAD>
> >
> > <BODY BGCOLOR="#FFFFFF">
> > <%
> >  ResultSet pippo = prova.Esegui(Integer.parseInt(IdFather));
> >  while (pippo.next())
> >  {
> >   out.println(pippo.getString("object")+"<BR>");
> >  }
> >  pippo.close();
> > %>
> > </BODY>
> > </HTML>
> >
> > Can anyone give me some help?????
> >
> > Thanks to everybody!!!!!!!!!!!
> >
> > Roberto
> >
> >
===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to