• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jdbc Odbc and bank transaction related question

 
wrushasen dakhane
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. What is the difference between jdbc and odbc?

2. Please explain the 4 levels of jdbc drivers?

3. Consider the bank situation where the husband and wife are holding the joint account and there is a balance amount of 1000/-.

Now the husband logs in through ATM also simultaneousl wife logs in through ATM.
Both of them see the amount of 1000/-.

Now husband has withdrawn 800/- amount and wife doesn't do anything.

Now the wife tries to withdraw the money but she does not know whether the husband has withdrawn 800/-.

Question is how the wife will come to know that the value has been updated?

Please explain in detail.

Wrushu
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, sounds a little like homework. If you post what you think the answers are people will provide feedback. I'll get you started, have you looked at our JDBC FAQs?
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the case that you have stated, the transaction will be different when the wife checks the amount and when she tries to withdraw the money. If in between these two transactions (after end of first and before start of second), husband withdraws the money, then it is not an issue, as at the start of the withdraw transaction, the balance will be checked again and that would result in an "insufficient funds" exception.
However, if both husband and wife tries to withdraw the amount at the same instant then it becomes a little complex and it depends on the application as to how they handle it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic