Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.openjpa.lib.jdbc
Class ConfiguringConnectionDecorator

    java.lang.Object
      org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator

All Implemented Interfaces:
  ConnectionDecorator

    public class ConfiguringConnectionDecorator

extends Object
implements ConnectionDecorator

Connection decorator that can configure some properties of the underlying connection. Understands the following properties:

- QueryTimeout
- TransactionIsolation(`Connection` constants)
- AutoCommit

Author:
  Abe White

Constructor Summary
`ConfiguringConnectionDecorator()`

Method Summary
`Connection` | `decorate(Connection conn)` Decorate the given connection if desired.
`Boolean` | `getAutoCommit()` Whether auto commit should be on.
`int` | `getQueryTimeout()` The number of seconds to wait for a query to execute before terminating it.
`int` | `getTransactionIsolation()` The transaction isolation level.
`void` | `setAutoCommit(Boolean autoCommit)` Whether auto commit should be on.
`void` | `setQueryTimeout(int timeout)` The number of seconds to wait for a query to execute before terminating it.
`void` | `setTransactionIsolation(int isolation)` The transaction isolation level.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ConfiguringConnectionDecorator

    public ConfiguringConnectionDecorator()

Method Detail

### getQueryTimeout

    public int getQueryTimeout()

  The number of seconds to wait for a query to execute before terminating it.

### setQueryTimeout

    public void setQueryTimeout(int timeout)

  The number of seconds to wait for a query to execute before terminating it.

### getTransactionIsolation

    public int getTransactionIsolation()

  The transaction isolation level.

### setTransactionIsolation

    public void setTransactionIsolation(int isolation)

  The transaction isolation level.

### getAutoCommit

    public Boolean getAutoCommit()

  Whether auto commit should be on. Use null to keep the connection's default setting. Defaults to null.

### setAutoCommit

    public void setAutoCommit(Boolean autoCommit)

  Whether auto commit should be on. Use null to keep the connection's default setting. Defaults to null.

### decorate

    public Connection decorate(Connection conn)
                        throws SQLException

  Description copied from interface: `ConnectionDecorator`
  Decorate the given connection if desired.

  Specified by:
    `decorate` in interface `ConnectionDecorator`
  Throws:
    `SQLException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 Apache Software Foundation. All Rights Reserved.