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.codehaus.activemq.store.jdbc.adapter
Class DefaultJDBCAdapter

    java.lang.Object
      org.codehaus.activemq.store.jdbc.adapter.DefaultJDBCAdapter

All Implemented Interfaces:
  JDBCAdapter

Direct Known Subclasses:
  BlobJDBCAdapter, BytesJDBCAdapter, StreamJDBCAdapter

public class DefaultJDBCAdapter
extends Object
implements JDBCAdapter

Implements all the default JDBC operations that are used by the JDBCPersistenceAdapter.

Subclassing is encouraged to override the default implementation of methods to account for differences in JDBC Driver implementations.

The JDBCAdapter inserts and extracts BLOB data using the getBytes()/setBytes() operations.

The databases/JDBC drivers that use this adapter are:

Version:
  $Revision: 1.7 $

Nested Class Summary

Nested classes inherited from class org.codehaus.activemq.store.jdbc.JDBCAdapter
`JDBCAdapter.MessageListResultHandler`

Field Summary
`protected LongSequenceGenerator` | `sequenceGenerator`
`protected CachingStatementProvider` | `statementProvider`

Constructor Summary
`DefaultJDBCAdapter()`
`DefaultJDBCAdapter(StatementProvider provider)`

Method Summary
`void` | `doAddMessage(Connection c, long seq, String messageID, String destinationName, byte[] data)`
`void` | `doAddXid(Connection c, ActiveMQXid xid, byte[] data)`
`void` | `doCreateTables(Connection c)`
`byte[]` | `doGetMessage(Connection c, long seq)`
`SubscriberEntry` | `doGetSubscriberEntry(Connection c, String destinationName, String sub)`
`void` | `doGetXids(Connection c, List list)`
`void` | `doLoadPreparedTransactions(Connection c, TransactionManager transactionManager)`
`void` | `doRecover(Connection c, String destinationName, JDBCAdapter.MessageListResultHandler listener)`
`void` | `doRecoverSubscription(Connection c, String destinationName, String subscriptionID, JDBCAdapter.MessageListResultHandler listener)`
`void` | `doRemoveMessage(Connection c, long seq)`
`void` | `doRemoveXid(Connection c, ActiveMQXid xid)`
`void` | `doSetLastAck(Connection c, String destinationName, String subscriptionID, long seq)`
`void` | `doSetSubscriberEntry(Connection c, String destinationName, String sub, SubscriberEntry subscriberEntry)`
`protected byte[]` | `getBinaryData(ResultSet rs, int index)`
`Long` | `getMessageSequenceId(Connection c, String messageID)`
`LongSequenceGenerator` | `getSequenceGenerator()`
`void` | `initSequenceGenerator(Connection c)`
`protected void` | `setBinaryData(PreparedStatement s, int index, byte[] data)`

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

Field Detail

### statementProvider

    protected final CachingStatementProvider statementProvider

### sequenceGenerator

    protected LongSequenceGenerator sequenceGenerator

Constructor Detail

### DefaultJDBCAdapter

    public DefaultJDBCAdapter(StatementProvider provider)

Parameters:
  `provider` -

### DefaultJDBCAdapter

    public DefaultJDBCAdapter()

Method Detail

### setBinaryData

    protected void setBinaryData(PreparedStatement s,
                                 int index,
                                 byte[] data)
                          throws SQLException

  Throws:
    `SQLException`

### getBinaryData

    protected byte[] getBinaryData(ResultSet rs,
                                   int index)
                            throws SQLException

  Throws:
    `SQLException`

### getSequenceGenerator

    public LongSequenceGenerator getSequenceGenerator()

  Specified by:
    `getSequenceGenerator` in interface `JDBCAdapter`

### doCreateTables

    public void doCreateTables(Connection c)
                        throws SQLException

  Specified by:
    `doCreateTables` in interface `JDBCAdapter`
  Throws:
    `SQLException`

### initSequenceGenerator

    public void initSequenceGenerator(Connection c)

  Specified by:
    `initSequenceGenerator` in interface `JDBCAdapter`

### doAddMessage

    public void doAddMessage(Connection c,
                             long seq,
                             String messageID,
                             String destinationName,
                             byte[] data)
                      throws SQLException,
                             JMSException

  Specified by:
    `doAddMessage` in interface `JDBCAdapter`
  Throws:
    `SQLException`
    `JMSException`

### getMessageSequenceId

    public Long getMessageSequenceId(Connection c,
                                     String messageID)
                              throws SQLException,
                                     JMSException

  Specified by:
    `getMessageSequenceId` in interface `JDBCAdapter`
  Throws:
    `SQLException`
    `JMSException`

### doGetMessage

    public byte[] doGetMessage(Connection c,
                               long seq)
                        throws SQLException

  Specified by:
    `doGetMessage` in interface `JDBCAdapter`
  Throws:
    `SQLException`

### doRemoveMessage

    public void doRemoveMessage(Connection c,
                                long seq)
                         throws SQLException

  Specified by:
    `doRemoveMessage` in interface `JDBCAdapter`
  Throws:
    `SQLException`

### doRecover

    public void doRecover(Connection c,
                          String destinationName,
                          JDBCAdapter.MessageListResultHandler listener)
                   throws SQLException,
                          JMSException

  Specified by:
    `doRecover` in interface `JDBCAdapter`
  Throws:
    `SQLException`
    `JMSException`

### doGetXids

    public void doGetXids(Connection c,
                          List list)
                   throws SQLException

  Specified by:
    `doGetXids` in interface `JDBCAdapter`
  Throws:
    `SQLException`

### doRemoveXid

    public void doRemoveXid(Connection c,
                            ActiveMQXid xid)
                     throws SQLException,
                            XAException

  Specified by:
    `doRemoveXid` in interface `JDBCAdapter`
  Throws:
    `SQLException`
    `XAException`

### doAddXid

    public void doAddXid(Connection c,
                         ActiveMQXid xid,
                         byte[] data)
                  throws SQLException,
                         XAException

  Specified by:
    `doAddXid` in interface `JDBCAdapter`
  Throws:
    `SQLException`
    `XAException`

### doLoadPreparedTransactions

    public void doLoadPreparedTransactions(Connection c,
                                           TransactionManager transactionManager)
                                    throws SQLException

  Specified by:
    `doLoadPreparedTransactions` in interface `JDBCAdapter`
  Throws:
    `SQLException`

### doSetLastAck

    public void doSetLastAck(Connection c,
                             String destinationName,
                             String subscriptionID,
                             long seq)
                      throws SQLException,
                             JMSException

  Specified by:
    `doSetLastAck` in interface `JDBCAdapter`
  Throws:
    `JMSException`
    `SQLException`
  See Also:
    `JDBCAdapter.doSetLastAck(java.sql.Connection, java.lang.String, java.lang.String, long)`

### doRecoverSubscription

    public void doRecoverSubscription(Connection c,
                                      String destinationName,
                                      String subscriptionID,
                                      JDBCAdapter.MessageListResultHandler listener)
                               throws SQLException,
                                      JMSException

  Specified by:
    `doRecoverSubscription` in interface `JDBCAdapter`
  Throws:
    `JMSException`
    `SQLException`
  See Also:
    `JDBCAdapter.doRecoverSubscription(java.sql.Connection, java.lang.String, java.lang.String, org.codehaus.activemq.store.jdbc.JDBCAdapter.MessageListResultHandler)`

### doSetSubscriberEntry

    public void doSetSubscriberEntry(Connection c,
                                     String destinationName,
                                     String sub,
                                     SubscriberEntry subscriberEntry)
                              throws SQLException

  Specified by:
    `doSetSubscriberEntry` in interface `JDBCAdapter`
  Throws:
    `SQLException`
  See Also:
    `org.codehaus.activemq.store.jdbc.JDBCAdapter#doSetSubscriberEntry(java.sql.Connection, java.lang.Object, org.codehaus.activemq.service.SubscriberEntry)`

### doGetSubscriberEntry

    public SubscriberEntry doGetSubscriberEntry(Connection c,
                                                String destinationName,
                                                String sub)
                                         throws SQLException

  Specified by:
    `doGetSubscriberEntry` in interface `JDBCAdapter`
  Throws:
    `SQLException`
  See Also:
    `org.codehaus.activemq.store.jdbc.JDBCAdapter#doGetSubscriberEntry(java.sql.Connection, java.lang.Object)`

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 © 2004 Protique, Ltd.. All Rights Reserved.