View RSS Feed

Java Database

Advantages of DataSource Objects

Rate this Entry
by , 03-10-2012 at 08:56 AM (1846 Views)
A DataSource object is considered a good alternative of class “DriverManager” and is most preferable to be used as it creates a database connection. There is no need to hard code the JDBC URL or driver name in application while using DataSource object. Such approach is loosely coupled & more portable.

When there is a need to do alterations then changes might be done in properties file by the admin and no code changes of ever application is needed, which is involved in its implementation.

Other than ease of maintenance and portability, DataSource object usage also offers many other advantages.

When DataSource interface gets implemented to do work along with implementation ConnectionPoolDataSource, connection produced will be pooled connections. Likewise, when it works with XADataSource then connections produced will be those that are usable in distributed transactions.

Submit "Advantages of DataSource Objects" to Facebook Submit "Advantages of DataSource Objects" to Digg Submit "Advantages of DataSource Objects" to Submit "Advantages of DataSource Objects" to StumbleUpon Submit "Advantages of DataSource Objects" to Google