Xiangdong Huang created IOTDB-538:
-------------------------------------
Summary: Add a simple Connection pool to simplify usage for
Session API
Key: IOTDB-538
URL: https://issues.apache.org/jira/browse/IOTDB-538
Project: Apache IoTDB
Issue Type: Sub-task
Components: Client/Java
Reporter: Xiangdong Huang
Druid is powerful but is complex for integration with IoTDB now. Besides,
before doing that, a more complete JDBC driver may be needed.
So, I'd like to add a simple client pool for session API (it is impossible to
let the pool be compatible with some session API does not use SQL when writing
data.) It is just for trying to let users reuse the connections.
If a user want to get a session client, just do:
client = pool.getconnection();
client.execute(something);
pool.putBack(client);
or
client = pool.getconnection();
ResultSet rset = client.execute(sql);
while(rset.hasNext){
rset.next();
}
rset.close();
pool.putBack(client);
The pool size can be limited (and blocking when there is no available
connections) or unlimited.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)