Managing JDBC DataSources

Managing JDBC DataSources (http://help.sap.com/saphelp_nw73/helpdata/en/4a/5d54c97df51cece10000000a42189b/frameset.htm)

 

You use this procedure to manage JDBC DataSources. The SAP NetWeaver Administrator enables you to:

  • Create JDBC DataSources

  • Delete JDBC DataSources

  • Manage connection pooling

  • Manage transaction isolation levels for connections

  • Define the type of connections using the SQL engine

     Caution

    When you perform an operation involving the default data source, you must restart the cluster node for the changes to take effect.

Prerequisites

You are in the  Configuration Infrastructure Application Resources function.

Procedure

Task

Steps

Create a custom JDBC DataSource

  1. Choose  Create New Resource New JDBC Custom DataSource .

    The New JDBC Custom DataSource Creation screen opens.

  2. Specify the name of the application that is associated to the JDBC DataSource in the Application Name field. The system uses this name for the configuration that holds the JDBC DataSource.

  3. Specify a unique name for the JDBC DataSource in the DataSource Name field. It is used when you look up the JDBC DataSource in the naming.

  4. Select a driver from the Driver Name dropdown list.

  5. Select the SQL type support from the SQL Engine dropdown list.

  6. Select the transaction isolation level from the Isolation Level dropdown list.

  7. Select the JDBC type support from the JDBC Version dropdown list.

    Depending on the JDBC version you choose, you have to enter the following additional information:

    • If you choose JDBC 1.x support, you have to enter a driver class name, database URL, user name, and password.

    • If you choose JDBC 2.0 support, you have to enter the data source type, ConnectionPool DataSource or XA DataSource. You must also enter the class name for the corresponding implementation provided by the driver and the vendor-specific initialization properties (serverName, portNumber, and so on).

    You may also specify the class name for the ObjectFactory, which provides instances of ConnectionPoolDataSource or XADataSource objects if there is one implemented by the driver vendor.

  8. Choose Save. The newly created DataSource appears in the list of custom JDBC DataSources.

Delete a custom JDBC DataSource

  1. Select the custom DataSource you want to delete from the Resources List.

  2. Choose Delete Selected Resource.

Define SQL type support

  1. Select a custom JDBC DataSource from the Resources List.

  2. Choose the Settings tab in the Resource Details area.

    To specify an SQL type support, select one of the available options from the SQL Engine dropdown list:

    • Open SQL – the system returns a Database Interface (DBI) CommonConnection. By choosing this option, you choose to use all functions provided by SAP's Open SQL for Java - that is, database vendor independence, SQL semantics, portability and syntax checks, SQL tracing mechanisms, statement caches, and table buffering.

    • Native SQL – the system returns a DBI DirectConnection. It provides only some of the functions of Open SQL for Java - SQL tracing, and statement caching.

    • Vendor SQL – the system returns a standard JDBC connection without using DBI at all.

    To save the selected option, choose Save.

Define transaction isolation level

  1. Select a custom JDBC DataSource from the Resources List.

  2. Choose the Settings tab in the Resource Details.

  3. Select one of the available options from the Isolation Level dropdown list box:

    • None - this level indicates that the database does not support transactions

    • Default - the isolation level of the database in use

       Note

      The default isolation level for an Open SQL data source is Read Uncommitted.

    • Read Uncommitted – this level enables transactions to read data that is being modified by other transactions before they either commit or roll back

    • Read Committed – this level enables transactions to read data only after the modifying transaction has committed

    • Repeatable Read – this level guarantees that the data the transaction reads is not being modified by another transaction and is not going to change unless the reading transaction modifies it and commits.

    • Serializable – this level guarantees maximum data integrity, since only one transaction run as a single serial operation can both read and modify the data at a time. Other transactions can access the data only after the serializable transaction has committed or rolled back.

  4. To save the selected option, choose Save.

Manage connection pooling

  1. Select a JDBC DataSource from the Resources List.

    Choose the Connection Pooling tab in the Resource Details.

  2. Specify the following parameters:

    • Initial Connections – number of connections that are obtained initially when the DataSource is created.

    • Maximum Connections – number of maximum connections from a single DataSource that are kept in the pool.

    • Maximum Time to Wait for Connection – when the maximum number of supported connections is reached and there are no free connections in the pool, the client waits the specified interval to obtain a connection. If the system does not return a connection to the pool during the interval, you get an exception thrown.

  3. (Optional) Select the Expiration checkbox, then specify the following parameters:

    • Connection Lifetime – A period in seconds after which the connection expires if it is not in use.

    • Cleanup Interval – An interval in seconds between two consecutive threads run by the system to clean up unused connections.

  4. To save the parameters, choose Save.

     Recommendation

    You can modify the properties values of the System DataSource using the Config Tool only.

    We recommend that you modify only the Maximum Connections value, if necessary.

    More information: Modifying Service, Manager, or Application Properties

你可能感兴趣的:(dataSource)