tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Gin" <Gin_C...@tvratings.com>
Subject RE: db taglibs questions
Date Mon, 15 Jul 2002 16:30:29 GMT
easy.. just do
<sql:getColumn position="1" to="field1" scope="page" />
<% int field1 = ((Integer)pageContext.getAttribute("field1")).intValue(); %>
All primative types gets translated to their appropriate wrappers. Its in
the docs for the to/scope of sql:getColumn
-Tim

-----Original Message-----
From: Igor Bursin [mailto:igoryan@sampo.ru]
Sent: Monday, July 15, 2002 12:25 PM
To: Tag Libraries Users List
Subject: Re: db taglibs questions


Yes,
<sql:getColumn position="1" to="field1" scope="page" />
<%= pageContext.getAttribute("field1") %>
it's ok, but if i'll write
<% int field1=pageContext.getAttribute("field1"); %>
I'll get next errors:
Can't convert java.lang.Object to int,

If i'm using db taglib from coldbeans software i'll can write:
<sql:setQuery id="query1" query="select A,B from T" res="B" />
<sql:getColumn res="B" position="1" id="C" />
A=<%=C%>
Can I make same with the jakarta db tablibs?

----- Original Message -----
From: "Mader, Steve" <steve.mader@eds.com>
To: "'Tag Libraries Users List'" <taglibs-user@jakarta.apache.org>
Sent: Monday, July 15, 2002 7:18 PM
Subject: RE: db taglibs questions


>
> Use the "to" property of the getColumn tag (see doco).
>
> e.g.   <sql:getColumn position="1" to="field1" />
>
> You can also use the optional scope parameter to set the scope.
>
> e.g.  <sql:getColumn position="1" to="field1" scope="page" />
>
> I think it defaults to page scope (others are request,session,....), which
> means you'd use the pageContext.getAttribute() method to extract the value
> (pageContext.getAttribute("field1")).  Hope this helps.
>
> Steve
>
> -----Original Message-----
> From: Igor Bursin [mailto:igoryan@sampo.ru]
> Sent: Monday, July 15, 2002 10:53 AM
> To: Tag Libraries Users List
> Subject: Re: db taglibs questions
>
>
> Hello, Kevin.
> I do not need to show results sql query through web. I want to write down
> results of sql query in variables that further them to use...
>
> ----- Original Message -----
> From: "Kevin Passey" <kpassey@kdpsoftware.co.uk>
> To: "'Tag Libraries Users List'" <taglibs-user@jakarta.apache.org>
> Sent: Monday, July 15, 2002 6:31 PM
> Subject: RE: db taglibs questions
>
>
> > Igor,
> >
> > Here is some of my code that displays database stuff in a table - I've
> only
> > given the row
> >
> >  <TR>
> >                 <td><sql:getColumn position="1"/></td>
> >                 <td><sql:getColumn position="2"/></td>
> >                 <td><sql:getColumn position="3"/></td>
> >                 <td><sql:getColumn position="4"/></td>
> >                 <td><sql:getColumn position="5"/></td>
> >                 <td><sql:getColumn position="6"/></td>
> >                 <td><sql:getColumn position="7"/></td>
> >                 <td><sql:getColumn position="8"/></td>
> >                 <td><sql:getColumn position="9"/></td>
> >                 <td><sql:getColumn position="10"/></td>
> >                 <td><sql:getColumn position="11"/></td>
> >                 <td><sql:getColumn position="12"/></td>
> >                 <td><sql:getColumn position="13"/></td>
> >                 <td><sql:getColumn position="14"/></td>
> >    </TR>
> >
> > Hope this helps
> >
> > Regards
> >
> > Kevin Passey
> >
> > -----Original Message-----
> > From: Igor Bursin [mailto:igoryan@sampo.ru]
> > Sent: 15 July 2002 15:06
> > To: taglibs-user@jakarta.apache.org
> > Subject: db taglibs questions
> >
> >
> > Hello!
> > I'm using DBTags Tag library.
> > I executes simple  query:
> > <sql:statement id="stmt1" conn="conn1">
> > <sql:query>
> > select string_value, number_value from my_table
> > </sql:query>
> > </sql:statement>
> > How i can output result:
> > <sql:setColumn position="1"> to the string or int variable (not to JSP
> > directly) ?
> > (i try <% A= <sql:setColumn position="1"> %>, but get error)
> >
> > Best regards, Igor Bursin.
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:taglibs-user-help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:taglibs-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:taglibs-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:
<mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:taglibs-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message