• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

one statement for two databses?

 
santhoshkumar samala
Ranch Hand
Posts: 156
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we use one statement for two databse connections?
 
Uwe Suelter
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
unfortinatly I don't think you can use statements for two connections, because you use connection.createStatement() to generate a statement.
Hope this answers your question.
Uwe
 
santhoshkumar samala
Ranch Hand
Posts: 156
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what happens if we close one connection and open another connction on the same statement?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Santoshkumar,
When you say the same statement, do you mean the same object or the same reference? The same object can't get a different connection because the connection is tied to the object (as pointed out above.) The same reference can, but then it is a new statement object.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might help if you described why you are trying to do this. It may be that you are looking for XA compliant Drivers and 2 phase commits...
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic