• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

calling a create statement method but unable to figure out how in my scenario

 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right now, I have something like the following in my try block:







So, for each of the IPAddresses that I got above in the `maindbsql`, that is `aa.aa.a.aaa` and `bb.bb.b.bbb` I want to call the `createStatement()` method in the following line mentioned in the above code:



Since, while establishing connection to these two IPAddresses, I am using `connections.put()` method as follows in the above code:


I don't have anything like Connection object `connRemote` that I have used for `xx.xx.x.xxx`, for my IP addresses aa.aa.a.aaa and bb.bb.b.bbb .

Could anyone please let me know if there is any way to overcome this problem?

Please let me know if I can answer any questions from my end.






P.S: The IP addresses I have used in my real code are IPV4 addresses and not alphabets.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think your code is too complicated. What's the purpose of putting the connections into a collection, then iterating through the collection (that's the part you didn't write yet), and then discarding the collection? Why not just something like


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic