aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Direct JDBC Connection Vs DataSource Connections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Direct JDBC Connection Vs DataSource Connections" Watch "Direct JDBC Connection Vs DataSource Connections" New topic
Author

Direct JDBC Connection Vs DataSource Connections

m prabhu
Ranch Hand

Joined: Jan 29, 2008
Posts: 79
what is the difference when
1.a web application uses a direct JDBC connection to interact with the RDBMS.
2.a web applciation uses a datasource functionality provided by the application server to interact with the RDBMS.

Please let me know the advantages and the disadvantages.

Regards,
Prabhu
Marut pandey
Ranch Hand

Joined: Mar 10, 2008
Posts: 43
If you have DataSource setup, you can Use Server's JNDI service to access DataSource object which gives you flexibility in connecting with different database without changing anything in application or in WAR.

Suppose you have three kind of Environment (Dev,QA, Prod) each of them should connect to separate databases. If you have used DataSource setup along with JNDI name. You just need to call JNDL name in you application and server at each environment with connect with appropriate database. Assuming each server has their own DataSource configured.
vivek srivastava
Ranch Hand

Joined: Nov 30, 2007
Posts: 39
We can use connection pooling functionality in 2 one but not in first one.
m prabhu
Ranch Hand

Joined: Jan 29, 2008
Posts: 79
thank you, Vivek & Marut
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Direct JDBC Connection Vs DataSource Connections