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, StreamJDBCAdapter

public class DefaultJDBCAdapter
extends java.lang.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.3 $

Nested Class Summary

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

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

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

Method Summary
`void` | `doAddMessage(java.sql.Connection c, long seq, java.lang.String messageID, java.lang.String destinationName, byte[] data)`
`void` | `doAddXid(java.sql.Connection c, ActiveMQXid xid, byte[] data)`
`void` | `doCreateTables(java.sql.Connection c)`
`byte[]` | `doGetMessage(java.sql.Connection c, long seq)`
`SubscriberEntry` | `doGetSubscriberEntry(java.sql.Connection c, java.lang.String destinationName, java.lang.String sub)`
`void` | `doGetXids(java.sql.Connection c, java.util.List list)`
`void` | `doLoadPreparedTransactions(java.sql.Connection c, TransactionManager transactionManager)`
`void` | `doRecover(java.sql.Connection c, java.lang.String destinationName, JDBCAdapter.MessageListResultHandler listener)`
`void` | `doRecoverSubscription(java.sql.Connection c, java.lang.String destinationName, java.lang.String subscriptionID, JDBCAdapter.MessageListResultHandler listener)`
`void` | `doRemoveMessage(java.sql.Connection c, long seq)`
`void` | `doRemoveXid(java.sql.Connection c, ActiveMQXid xid)`
`void` | `doSetLastAck(java.sql.Connection c, java.lang.String destinationName, java.lang.String subscriptionID, long seq)`
`void` | `doSetSubscriberEntry(java.sql.Connection c, java.lang.String destinationName, java.lang.String sub, SubscriberEntry subscriberEntry)`
`protected byte[]` | `getBinaryData(java.sql.ResultSet rs, int index)`
`SequenceGenerator` | `getSequenceGenerator()`
`void` | `initSequenceGenerator(java.sql.Connection c)`
`protected void` | `setBinaryData(java.sql.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 SequenceGenerator sequenceGenerator

Constructor Detail

### DefaultJDBCAdapter

    public DefaultJDBCAdapter(StatementProvider provider)

Parameters:
  `provider` -

### DefaultJDBCAdapter

    public DefaultJDBCAdapter()

Method Detail

### setBinaryData

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

  Throws:
    `java.sql.SQLException`

### getBinaryData

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

  Throws:
    `java.sql.SQLException`

### getSequenceGenerator

    public SequenceGenerator getSequenceGenerator()

  Specified by:
    `getSequenceGenerator` in interface `JDBCAdapter`

### doCreateTables

    public void doCreateTables(java.sql.Connection c)
                        throws java.sql.SQLException

  Specified by:
    `doCreateTables` in interface `JDBCAdapter`
  Throws:
    `java.sql.SQLException`

### initSequenceGenerator

    public void initSequenceGenerator(java.sql.Connection c)

  Specified by:
    `initSequenceGenerator` in interface `JDBCAdapter`

### doAddMessage

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

  Specified by:
    `doAddMessage` in interface `JDBCAdapter`
  Throws:
    `java.sql.SQLException`
    `JMSException`

### doGetMessage

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

  Specified by:
    `doGetMessage` in interface `JDBCAdapter`
  Throws:
    `java.sql.SQLException`

### doRemoveMessage

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

  Specified by:
    `doRemoveMessage` in interface `JDBCAdapter`
  Throws:
    `java.sql.SQLException`

### doRecover

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

  Specified by:
    `doRecover` in interface `JDBCAdapter`
  Throws:
    `java.sql.SQLException`
    `JMSException`

### doGetXids

    public void doGetXids(java.sql.Connection c,
                          java.util.List list)
                   throws java.sql.SQLException

  Specified by:
    `doGetXids` in interface `JDBCAdapter`
  Throws:
    `java.sql.SQLException`

### doRemoveXid

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

  Specified by:
    `doRemoveXid` in interface `JDBCAdapter`
  Throws:
    `java.sql.SQLException`
    `XAException`

### doAddXid

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

  Specified by:
    `doAddXid` in interface `JDBCAdapter`
  Throws:
    `java.sql.SQLException`
    `XAException`

### doLoadPreparedTransactions

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

  Specified by:
    `doLoadPreparedTransactions` in interface `JDBCAdapter`
  Throws:
    `java.sql.SQLException`

### doSetLastAck

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

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

### doRecoverSubscription

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

  Specified by:
    `doRecoverSubscription` in interface `JDBCAdapter`
  Throws:
    `JMSException`
    `java.sql.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(java.sql.Connection c,
                                     java.lang.String destinationName,
                                     java.lang.String sub,
                                     SubscriberEntry subscriberEntry)
                              throws java.sql.SQLException

  Specified by:
    `doSetSubscriberEntry` in interface `JDBCAdapter`
  Throws:
    `java.sql.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(java.sql.Connection c,
                                                java.lang.String destinationName,
                                                java.lang.String sub)
                                         throws java.sql.SQLException

  Specified by:
    `doGetSubscriberEntry` in interface `JDBCAdapter`
  Throws:
    `java.sql.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.