Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

connecting to different databases  RSS feed

 
Robin Richardson
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to connect to 4 different databases, pulling info from 3 to send to the 4th. Should I use some kind of set up with threads or something else.
Thanks
Robin
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
yeah, why not use threads.
if the querys to the 3 db's are not dependent on each other (-> can be executed in "parallel") then you could save some time. only make sure that you update db4 only after all 3 queries were successfull.
pascal
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could do that by spawning three threads, joining them (to wait till they complete), and then write to the fourth db in the main thread.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!