• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why do we need datasource

 
firoz silar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
why do we need datasources, we can directly get the connection from
from connection pool.

regards,
Firoz.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firoz,
It protects your code from change. If you use a DataSource, your code doesn't need to be aware of the database, password, type of driver, etc. It also allows the driver to be connection pooling and or XA (two phase commit) without changing the code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic