Sunday, July 21, 2013

What is JDBC Provider and Datasource in Websphere?



When an application or WebSphere component requires access to a database, that database must be defined to WebSphere as a data source. Two basic definitions are required:

1. A JDBC provider definition defines an existing database provider, including the type of database access that it provides and the location of the database vendor code that provides the implementation.

2. A data source definition defines which JDBC provider to use, the name and location of the database, and other connection properties.

JDBC resources

The JDBC API provides a programming interface for data access of relational databases from the Java programming language. WebSphere Application Server V7 supports the following JDBC APIs:

1. JDBC 4.0 (New in V7)
2. JDBC 3.0
3. JDBC 2.1 and Optional Package API (2.0)

The following database platforms are supported for JDBC:

_ DB2
_ Oracle
_ Sybase
_ Informix®
_ SQL Server
_ IBM Cloudscape and IBM Derby (test and development only)
_ Third-party vendor JDBC data source using SQL99 standards

JDBC providers and data sources

A data source represents a real-world data source, such as a relational database. When a data source object is registered with a JNDI naming service, an application can retrieve it from the naming service and use it to make a connection to the data source that it represents.

Information about the data source and how to locate it, such as its name, the server on which it resides, its port number, and so on, is stored in the form of properties on the DataSource object. Storing this information in this manner makes an application more portable because it does not need to hard code a driver name, which often includes the name of a particular vendor. It also makes
maintaining the code easier because if, for example, the data source is moved to a different server, all that needs to be done is to update the relevant property in the data source. None of the code using that data source needs to be touched.

After a data source is registered with an application server’s JNDI name space, application programmers can use it to make a connection to the data source that it represents.

The connection usually is a pooled connection. In other words, when the application closes the connection, the connection is returned to a connection pool, rather than being destroyed. Data source classes and JDBC drivers are implemented by the data source vendor. By configuring a JDBC provider, you provide information about the set of classes that are used to implement the data source and the database driver. Also, you provide the environment settings for the DataSource object. A driver can be written purely in the Java programming language or in a mixture of the Java programming language and the Java Native Interface (JNI) native methods.


Good Day....
Amit Kumar Roy

No comments:

Post a Comment