• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Generate JTable from a SQL Query containing UNION clause

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends...

Following is the code that i write to convert the Data returned from the ResultSet of an SQL query, to be filled into a JTable.

This code works fine for the normal query....but in the case of a SQL query containing a UNION clause For eg. :

SELECT * FROM Table_1
UNION
SELECT * FROM Table_2


it only returns the results of the first part of the above query..i.e. for

SELECT * FROM Table_1




Please tell me if there are any changes required in this above code OR if there is any SQL driver problem...If its a driver problem, then please tell me what i am suppose to do (I am using MS Access as my database)

Also i wanted to know, how to detect what type of data each column of the ResultSet is returning, and thus display type-specific data in the JTable, especially the Date.
The above code by default displays the date in 2006-11-28 hr:min:sec format, but i want it as dd/MM/yyyy
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic