File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes wether JDBC supports UNION Queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "wether JDBC supports UNION Queries" Watch "wether JDBC supports UNION Queries" New topic

wether JDBC supports UNION Queries

Sunil Mamindla

Joined: Oct 19, 2000
Posts: 8
Hai !

How will we find wether JDBC supports UNION Queries

Thank's in advance

shailesh sonavadekar
Ranch Hand

Joined: Oct 12, 2000
Posts: 1874
please go to & there are various types of jdbc drivers . You will get all the information about them on that site & bprobably in those documents only you will get the answer for union querries suppported by jdbc.
i hope this is useful.

Joined: Jan 22, 2000
Posts: 20
Hi Sunil,
UNION queries are defined as standard SQL syntax and are hence defined by all ASNI SQL compliant databases. So u shouldn' thave a problem with UNION.
If however u do want to check, i would suggest firing a UNIONquery and checking for an SQLException. It's not very clean, but i guess JDBC drivers do not allow u to access their properties.
Hope it helps,
Matt Midcap

Joined: Jan 07, 1999
Posts: 440
I'm moving this to the "JDBC" forum.

Best Regards,<br />Matt Midcap
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
I think there may be some confusion here. Most JDBC drivers simply pass the SQL to the appropriate database, and whether any particular SQL features are supported depends entirely on the database. I have happily used UNION in queries to Oracle 7 through the Oracle 7 thin driver.
What database are you using?

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Sandeep Jain
Ranch Hand

Joined: Oct 25, 2000
Posts: 124
You can make use of the of the builtin fuction called supportsUnion() which returns a boolean value . This method is available in DatabaseMetaData interface.

Sandeep Jain

Try and Try Till u succeed<br /> <br />Sandeep Jain
I agree. Here's the link:
subject: wether JDBC supports UNION Queries
jQuery in Action, 3rd edition