Subject | Re: [Firebird-Java] How to get column names as first row? (or why I would need ResultSet.first() and ResultSet.previous()) |
---|---|
Author | Yves Glodt |
Post date | 2010-08-23T19:57:10Z |
Thanks for the hint, I am aware of ResultSetMetaData and already use it. How
to get the names as first row without iterating twice is still beyond my
knowledge however.
to get the names as first row without iterating twice is still beyond my
knowledge however.
On 19 August 2010 11:00, Mark Rotteveel <Avalanche1979@...> wrote:
>
>
> On 18-8-2010 23:10, Yves Glodt wrote:
> > Hi,
> >
> > I have a case where I iterate over a resultset, and I want to print out
> the
> > column names as first row.
> >
> > All this should be fast, so I do not want to call
> > PreparedStatement.executeQuery twice.
> >
> > So I was thinking to call resultset.next once, iterate of the columns to
> get
> > the names, then "rewind" the resultset, and iterate over it completely to
> > get the actual data.
> > Unfortunately this does not work since the calls ResultSet.first() and
> > ResultSet.previous() are "not yet implemented"
> >
> > Anyone got another idea how I can do what I need to do? Btw this is using
> > jaybird 2.1.6 on firebird 1.5.
>
> Use the resultset metadata (getMetaData()) and retrieve the columnnames
> from the returned ResultSetMetaData object.
>
> Mark
>
> --
> Mark Rotteveel
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
[Non-text portions of this message have been removed]