ResultSet rs = null;
        Connection con = getDbConnect();
        StringBuffer sql = new StringBuffer(512);
        sql.append("select
a.alert_id,a.subject,a.body,a.create_date,a.sender,atg.read_flag ");
        sql.append("from alert a, alerttargetgroup atg,usergroupids ugids "
);
        sql.append(" where ugids.groupid = atg.groupid and ");
        sql.append("  ugids.username =? and atg.alert_id = a.alert_id ");
        sql.append(" union ");
        sql.append("select
a.alert_id,a.subject,a.body,a.create_date,a.sender,atu.read_flag ");
        sql.append(" from alert a, alerttargetuser atu ");
        sql.append(" where atu.username =? and atu.alert_id = a.alert_id ");


       try{
        PreparedStatement stmt = con.prepareStatement(sql.toString());

        stmt.clearParameters();
        stmt.setString(1,username);
        stmt.setString(2,username);
        rs = stmt.executeQuery();
        }catch(SQLException e){System.out.println("sql wrong");}

if i take the a.body off the select stmt, other fields are retrival OK.


>From: Joe Milora <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: SQL question for long data type
>Date: Thu, 15 Jun 2000 11:11:14 -0500
>
>Sounds like a problem with the statement itself, not the retrieval of
>value.
>What is the actual select statement?
>
>
>-----Original Message-----
>From: helen ge [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, June 15, 2000 10:42 AM
>To: [EMAIL PROTECTED]
>Subject: Re: SQL question for long data type
>
>
>SQLException "ORA-00997 illegal use of Long data type"
>
>
> >From: Joe Milora <[EMAIL PROTECTED]>
> >Reply-To: A mailing list about Java Server Pages specification and
> >     reference <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: SQL question for long data type
> >Date: Thu, 15 Jun 2000 10:34:54 -0500
> >
> >rs.getString and (String)rs.getObject should work. What is the error
>you're
> >receiving?
> >
> >-----Original Message-----
> >From: Rob van Oostrum [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, June 15, 2000 9:39 AM
> >To: [EMAIL PROTECTED]
> >Subject: Re: SQL question for long data type
> >
> >
> >are you sure the pointer is not at a row that has no value for that
>column?
> >
> > > -----Original Message-----
> > > I have an oracle table which has a long data type field named body.
> > > in my java code I created a SQL and try to get that long field througn
> > > ResultSet and print it out as a String.
> > >
> > >
> > > String body = rs.getString("body");--- does not work.
> > > long body = rs.getLong("body");--- does not work.
> > > String body = (String) rs.getObject("body");-- not work.
> > >
> > > How can I correctly doing that?
> >
> >===========================================================================
> >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
>
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>===========================================================================
>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

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

===========================================================================
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