com.taosdata.jdbc

## Class TSDBSubscribe

- java.lang.Object
- - com.taosdata.jdbc.TSDBSubscribe

    public class TSDBSubscribe
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`TSDBSubscribe(TSDBJNIConnector connecter)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`TSDBResultSet` `consume(long subscription)`
`static ScheduledExecutorService` `getTimerInstance()`
`long` `subscribe(String topic, String sql, boolean restart, int period)` sync subscribe
`long` `subscribe(String topic, String sql, boolean restart, int period, TSDBSubscribeCallBack callBack)` async subscribe
`void` `unsubscribe(long subscription, boolean isKeep)` cancel subscribe

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TSDBSubscribe

    public TSDBSubscribe(TSDBJNIConnector connecter)
                  throws SQLException

Throws:
  `SQLException`

### Method Detail

#### getTimerInstance

    public static ScheduledExecutorService getTimerInstance()

#### subscribe

    public long subscribe(String topic,
                          String sql,
                          boolean restart,
                          int period)
                   throws SQLException

sync subscribe

Parameters:
  `topic` -
  `sql` -
  `restart` -
  `period` -
Throws:
  `SQLException`

#### subscribe

    public long subscribe(String topic,
                          String sql,
                          boolean restart,
                          int period,
                          TSDBSubscribeCallBack callBack)
                   throws SQLException

async subscribe

Parameters:
  `topic` -
  `sql` -
  `restart` -
  `period` -
  `callBack` -
Throws:
  `SQLException`

#### consume

    public TSDBResultSet consume(long subscription)
                          throws OperationsException,
                                 SQLException

Throws:
  `OperationsException`
  `SQLException`

#### unsubscribe

    public void unsubscribe(long subscription,
                            boolean isKeep)
                     throws SQLException

cancel subscribe

Parameters:
  `subscription` -
  `isKeep` -
Throws:
  `SQLException`