Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Transpose in java

Thread view: 
nk - 02 Sep 2006 03:35 GMT
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?
---------------------------------------------------------------------



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.