View RSS Feed

Connection

JDBC Connection

  1. Getting and Using Pooled Connections

    by , 04-27-2012 at 07:06 PM
    A connection pool is a cache of database connection objects. The objects represent physical database connections that can be used by an application to connect to a database. At run time, the application requests a connection from the pool. If the pool contains a connection that can satisfy the request, it returns the connection to the application. If no connections are found, a new connection is created and returned to the application. The application uses the connection to perform some work on ...
    Categories
    Connection
  2. Advantages of DataSource Objects

    by , 04-27-2012 at 07:05 PM
    Because of its properties, a DataSource object is a better alternative than the DriverManager class for getting a connection. Programmers no longer have to hard code the driver name or JDBC URL in their applications, which makes them more portable. Also, DataSource properties make maintaining code much simpler. If there is a change, the system administrator can update data source properties and not be concerned about changing every application that makes a connection to the data source. For example, ...
  3. Using DataSource Objects to Get a Connection

    by , 04-27-2012 at 07:04 PM
    Objects instantiated by classes that implement the DataSource represent a particular DBMS or some other data source, such as a file. A DataSource object represents a particular DBMS or some other data source, such as a file. If a company uses more than one data source, it will deploy a separate DataSource object for each of them. The DataSource interface is implemented by a driver vendor. It can be implemented in three different ways:

    A basic DataSource implementation produces standard ...
    Categories
    Connection
  4. Establishing a Connection

    by , 04-27-2012 at 07:03 PM
    First, you need to establish a connection with the data source you want to use. A data source can be a DBMS, a legacy file system, or some other source of data with a corresponding JDBC driver. Typically, a JDBC application connects to a target data source using one of two classes:

    • DriverManager: This fully implemented class connects an application to a data source, which is specified by a database URL. When this class first attempts to establish a connection, it automatically
    ...