I am new to Ormlite. I need to close the connectionSource. Tried close. During query execution, connections are implicitly opened. How to prevent this. How to close the connection correctly?
Sample code:
import com.j256.ormlite.jdbc.JdbcConnectionSource;
import com.j256.ormlite.support.ConnectionSource;
ConnectionSource connectionSource =
new JdbcConnectionSource(url + databaseName + "?currentSchema=trial&useSSL=false",
userName, password);
connectionSource.close();
The below output shows that query are executed by same connection object even after closing it.
DaoManager created dao for class class com.zcpersistence.entity1508480.test with reflection
StatementExecutor query of 'SELECT COUNT(*) FROM `test`' returned 1
JdbcConnectionSource closed connection #1020391880
JdbcConnectionSource opened connection to jdbc:mysql:*********
StatementExecutor query of 'SELECT COUNT(*) FROM `test`' returned 1
Thanks ahead!