This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes need help implementing the Union operator(SQL) in java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "need help implementing the Union operator(SQL) in java" Watch "need help implementing the Union operator(SQL) in java" New topic
Author

need help implementing the Union operator(SQL) in java

varuna iyengar
Greenhorn

Joined: Aug 22, 2010
Posts: 3
I need to implement the union operator for the union of two tables in java. I have checked for table compatibility(i.e. the attributes and the data types match correctly), but need to append the data tuples of the two individual tables into one table. Please let me know how to go about it.

Thanks
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

First of all welcome to the Java Ranch. What have you tried? And what kind of problems did you encounter?


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
varuna iyengar
Greenhorn

Joined: Aug 22, 2010
Posts: 3
Thanks. I'm actually using java to implement the Union operation of SQL. I have checked the two tables in question for compatibility i.e the attributes and their corresponding data types match completely. Now, I need to combine the data tuples of both these tables to one. Any in-built functions in java that could help me do it?
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

You just basically copied the content of your first post. Is your table a java class or do you mean a database table? In either case what have you tried to join them? Show some code. ShowSomeEffort
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

By the way: we have a name policy.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32675
    
    4
Moving to our databases forum where this sort of question is usually asked.
varuna iyengar
Greenhorn

Joined: Aug 22, 2010
Posts: 3
Sorry about the goof up about the display name. Also, I found a solution to my problem. Thanks anyways
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32675
    
    4
And what was the solution? Others will benefit from knowing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help implementing the Union operator(SQL) in java
 
Similar Threads
Help with an SQL Statement
UNION for Columns of CLOB data type does not work
[ProgrammerSeeksPattern] synchronize data
Passing Array references
EXISTS/UNION Combination