Hi, I have a large table in postgres database. I need to create a
screen in Java to view this table but it hast to be transposed. I'm
wondering if it's better to transpose it in Postgres or Java could do
it for me. Which is a better approach? What is the best way to
transpose a table in Java? What is the best way to transpose it in
Postgress.
Your help is greatly appreciated.
Thanks
NK
hiwa - 02 Sep 2006 04:33 GMT
nk のメッセージ:
> Hi, I have a large table in postgres database. I need to create a
> screen in Java to view this table but it hast to be transposed. I'm
[quoted text clipped - 5 lines]
> Thanks
> NK
Manipulating the table model data for a javax.swing.JTable should be
much much easier than redefining a DB scheme.
nk - 02 Sep 2006 05:19 GMT
> nk のメッセージ:
>
[quoted text clipped - 9 lines]
> Manipulating the table model data for a javax.swing.JTable should be
> much much easier than redefining a DB scheme.
Thanks for your response. The only problem is, I will not be using
swing. I will be using core java/struts/jsp...
Any more ideas will be appreciated...
Thanks
NK
hiwa - 02 Sep 2006 06:35 GMT
nk のメッセージ:
> > nk のメッセージ:
> >
[quoted text clipped - 14 lines]
> Thanks
> NK
Then, you will be hand-coding your <TR>s and <TD>s in the JSP or
servlet.
That should be, however, still easier than modifying DB relations.
Chris Uppal - 02 Sep 2006 09:42 GMT
> Then, you will be hand-coding your <TR>s and <TD>s in the JSP or
> servlet.
> That should be, however, still easier than modifying DB relations.
It may help to use an array of temporary StringWriters or StringBuilders, one
for each input row/output column, so that you (the OP) can transpose the table
in one pass over the data.
-- chris
Greg R. Broderick - 03 Sep 2006 00:31 GMT
"nk" <nkunkov@gmail.com> wrote in news:1157164551.608477.317670
@b28g2000cwb.googlegroups.com:
> I need to create a screen in Java to view this table but it hast to be
> transposed.
Could you define "transposed" more exactly? Do you mean that you want rows
in the database table to become columns in your screen, and vice-versa? It
is possible that this may best be accomplished by modifying your SQL query,
but one would need to have a lot more information about your database schema
and what you're trying to do in order to advise you most fully.
Cheers!
GRB

Signature
---------------------------------------------------------------------
Greg R. Broderick gregb.usenet200607@blackholio.dyndns.org
A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------