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 2007

Tip: Looking for answers? Try searching our database.

getColumnCount() ???

Thread view: 
pincopallo_it@yahoo.it - 11 Sep 2007 09:17 GMT
In my project I have a query like this:

query= "SELECT ID_STEZ, B.ID_PAR, B.VALORE WHERE
A.ID_STEZ = B.ID_STEZ AND B.ID_PAR = C.ID_PAR(+) AND A.ID_RET =
D.ID_RET  AND A.ID_STEZ IN " +
stuz + " AND B.ID_PAR IN " + clim + " AND C.ID_PAR = B.ID_PAR"

which is perfectly working.
The variable stuz is like this : (12,45,64,85,127,476)
The variable clim is like this : (122,5,164,45,27,46)

The result of the query at the moment is stored in a TreeMap.
The problem is that if there is no data for clim (let's say) 5
i have not the column for clim 5

ResultSet rset = stmt.executeQuery (query);
result.setNumCols(rset.getMetaData().getColumnCount());
... and the getColumnCount() don't consider the clim "5"

but I need a column for clim 5 as I have to fill the column
with "nodata" when I publish the web page !!!

How to solve it ????
Thomas Kellerer - 11 Sep 2007 09:26 GMT
pincopallo_it@yahoo.it, 11.09.2007 10:17:
> In my project I have a query like this:
>
[quoted text clipped - 4 lines]
>
> which is perfectly working.
No it's not.
The above is not a valid SQL Statement (the FROM part is missing).

> The variable stuz is like this : (12,45,64,85,127,476)
> The variable clim is like this : (122,5,164,45,27,46)
[quoted text clipped - 9 lines]
> but I need a column for clim 5 as I have to fill the column
> with "nodata" when I publish the web page !!!

Your SELECT only has three columns (id_stez, id_par and valore) so you
will never get more columns.

If there is a row (!) with id_par = 5 (that's your "clim 5") then you'll
get more rows, not more columns.

Thomas


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.