Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to merge multiple ResultSet to 1

 
andy lau Ies
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i use the same preparedStatement to retrieve multiple results sets from different databases and the all databases set up is the same (same cols and types)
i was wondering if there was a way to merge those ResultSets to one ResultSet but not changing data type of each data ?

Actually, i tried successfully merged them, but data type of all data in the merged ResultSets becomes "Object"
So, if i use mergedResultSet.getInt("IntegerColumn"); it throws exception, only mergedResultSet.getObject("IntegerColumn") can retrieve the data.

How to combine those ResultSet but not change the data type of each data ?
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how did you get the mergedresultset?

I think you need to do it programatically (in Java making a new class with it's own hash method and using a map. (this is like playing QI I am now waiting for the -25 claxon to go off now, discovered QI hasn't got outside the uk, so here is a wiki linkQI)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic