View RSS Feed

Java Database

  1. Advantages of DataSource Objects

    by , 03-10-2012 at 08:56 AM
    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. ...
    Categories
    JDBC
  2. Using DataSource Objects to Get a Connection

    by , 03-10-2012 at 08:54 AM
    Classes instantiate object which implement Datasource. This presents particular some data source like a file, or DBMS.

    A particular DBMS is presented by a DataSource object. For more than 1 data source usage, it is required to have separate DataSource objects for every data source. There are 3 ways for implementation of the DataSource interface.

    • Standard Connection objects are produced by the implementation of basic DataSource. These objects are not used or pooled
    ...
    Categories
    JDBC