aspose file tools*
The moose likes JDBC and the fly likes Direct JDBC Connection Vs DataSource Connection 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 » Databases » JDBC
Bookmark "Direct JDBC Connection Vs DataSource Connection" Watch "Direct JDBC Connection Vs DataSource Connection" New topic
Author

Direct JDBC Connection Vs DataSource Connection

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
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9426
    
    2

With the first approach, you have to manually manage transactions, database connection pooling and stuff but with the latter, you get that from the container.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Jothi Shankar Kumar wrote:With the first approach, you have to manually manage transactions, database connection pooling and stuff but with the latter, you get that from the container.


either direct jdbc connection(type1) nor datasource support implicit transaction, thats is your own logic.

and read this why ConnectionPooling is prefer over JDBC connection
Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804
    
    1

This question is not about SCWCD. It should be moved to different place.


SCJP6, SCWCD5, OCE:EJBD6.
BLOG: http://leakfromjavaheap.blogspot.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Direct JDBC Connection Vs DataSource Connection