Transpose in java

N

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

hiwa

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
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
Manipulating the table model data for a javax.swing.JTable should be
much much easier than redefining a DB scheme.
 
N

nk

hiwa said:
nk ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸:

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
 
H

hiwa

nk ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸:
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
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.
 
C

Chris Uppal

hiwa said:
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
 
G

Greg R. Broderick

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

--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top