Sunday, 21 August 2016

Data Source in Weblogic

In WebLogic Server, you can configure database connectivity by configuring JDBC data sources and multi data sources and then targeting or deploying the JDBC resources to servers or clusters in your WebLogic domain.

In WebLogic Server, you configure database connectivity by adding data sources to your WebLogic domain. WebLogic JDBC data sources provide database access and database connection management. Each data source contains a pool of database connections that are created when the data source is created and at server startup. Applications reserve a database connection from the data source by looking up the data source on the JNDI tree or in the local application context and then callinggetConnection(). When finished with the connection, the application should call connection.close() as early as possible, which returns the database connection to the pool for other applications to use.
JDBC: Java database connectivity (JDBC) is the JavaSoft specification of a standard application programming interface (API) that allows Java programs to access database management systems. The JDBC API consists a set of interfaces and classes written in the Java programming language.  Using these standard interfaces and classes, programmers can write applications that connect to databases, send queries written in structured query language (SQL), and process the results.
Steps to configure Data Source in Weblogic Domain

Before Configuring Data Source with Weblogic We have to have the following data Ready :
1.Data Base Should be installed and a Database should be created for Weblogic to use
2.DBA should create a user for the database access .
3.DBA should provide the information like IP address,Port and Service Name of the instance running.
Picture












For creating Data Source Click on Services==>Data Source===>New

WebLogic Server provides three types of data sources:

  • Generic Data Sources—Generic data sources and their connection pools provide connection management processes that help keep your system running efficiently.You can set options in the data source to suit your applications and your environment.
  • Grid Link Data Sources—An event-based data source that adaptively responds to state changes in an Oracle RAC instance. See Using Grid Link Data Sources.
  • Multi data sources—A multi data source is an abstraction around a group of generic data sources that provides load balancing or fail over processing.

              Click on the Generic Data Sources


Picture











JDBC data source names are used to identify the data source within the WebLogic domain. For system resource data sources, names must be unique among all other JDBC system resources, including data sources and multi data sources.

JNDI Names You can configure a data source so that it binds to the JNDI tree with a single or multiple names.

Selecting a Database Type
Select a DBMS.
Click on "Next"



Picture












When creating a JDBC data source using the Administration Console, you are prompted to select a JDBC driver class. The Administration Console provides most of the more common driver class names and in most cases tries to help you construct the URL as required by the driver. You should verify, however, that the URL is as you want it before asking the console to test it. The driver you select must be in the classpath on all servers on which you intend to deploy the data source. Some but not all JDBC drivers listed in the Administration Console are shipped (and/or are already in the classpath) with WebLogic Server:


  •         Oracle Thin Driver

    • Oracle Thin Driver XA

    • Oracle Thin Driver non-XA
      All of these drivers are referenced by the weblogic.jar manifest file and do not need to be explicitly defined in a server's classpath.

      When deciding which JDBC driver to use to connect to a database, you should try drivers from various vendors in your environment. In general, JDBC driver performance is dependent on many factors, especially the SQL code used in applications and the JDBC driver implementation.
    • Click on "Next"

Picture













When you configure a JDBC data source using the Administration Console, WebLogic Server automatically selects specific transaction options based on the type of JDBC driver:

For XA drivers, the system automatically selects the Two-Phase Commit protocol for global transaction processing.

For non-XA drivers, local transactions are supported by definition, and WebLogic Server offers the following options

Supports Global Transactions: (selected by default) Select this option if you want to use connections from the data source in global transactions, even though you have not selected an XA driver

Logging Last Resource: With this option, the transaction branch in which the connection is used is processed as the last resource in the transaction and is processed as a local transaction.

Emulate Two-Phase Commit: With this option, the transaction branch in which the connection is used always returns success for the prepare phase of the transaction. It offers performance benefits, but also has risks to data in some failure conditions.

One-Phase Commit: (selected by default) With this option, a connection from the data source can be the only participant in the global transaction and the transaction is completed using a one-phase commit optimization.

Click on "Next"

Picture












Connection Properties are used to configure the connection between the data source and the DBMS. Typical attributes are the database name, host name, port number, user name, and password.


Click on "Next"

Picture












Test Connections Test Database Connection allows you to test a database connection before the data source configuration is finalized using a table name or SQL statement. If necessary, you can test additional configuration information using the Properties and System Properties attributes.

Click on "Next"

Picture












Target the Data Source

You can select one or more targets to deploy your new JDBC data source. If you don't select a target, the data source will be created but not deployed. You will need to deploy the data source at a later time.

Click on "Next"

Picture












Each JDBC data source has a pool of JDBC connections that are created when the data source is deployed or at server startup. Applications use a connection from the pool then return it when finished using the connection. Connection pooling enhances performance by eliminating the costly task of creating database connections for the application.

The Data Base have been configured in the Weblogic which can be used by the application .

No comments:

Post a Comment