Package com.qwazr.library.jdbc
Class JdbcConnector
java.lang.Object
com.qwazr.library.AbstractLibrary
com.qwazr.library.AbstractPasswordLibrary
com.qwazr.library.jdbc.JdbcConnector
- All Implemented Interfaces:
com.qwazr.library.LibraryInterface,java.io.Closeable,java.lang.AutoCloseable
public class JdbcConnector
extends com.qwazr.library.AbstractPasswordLibrary
implements java.io.Closeable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJdbcConnector.ConnectionPool -
Field Summary
Fields Modifier and Type Field Description java.lang.StringdriverJdbcConnector.ConnectionPoolpooljava.lang.Stringurljava.lang.Stringusername -
Constructor Summary
Constructors Constructor Description JdbcConnector() -
Method Summary
Modifier and Type Method Description voidclose()com.qwazr.utils.jdbc.TransactiongetConnection(com.qwazr.utils.IOUtils.CloseableContext context)com.qwazr.utils.jdbc.TransactiongetConnection(com.qwazr.utils.IOUtils.CloseableContext context, boolean autoCommit)com.qwazr.utils.jdbc.TransactiongetConnection(com.qwazr.utils.IOUtils.CloseableContext context, boolean autoCommit, int transactionIsolation)java.lang.IntegergetPoolNumActive()The current number of active connections that have been allocated from this connection pool.java.lang.IntegergetPoolNumIdle()The current number of idle connections that are waiting to be allocated from this connection pool.voidload()
-
Field Details
-
Constructor Details
-
JdbcConnector
public JdbcConnector()
-
-
Method Details
-
load
public void load()- Specified by:
loadin interfacecom.qwazr.library.LibraryInterface
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
getConnection
public com.qwazr.utils.jdbc.Transaction getConnection(com.qwazr.utils.IOUtils.CloseableContext context) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getConnection
public com.qwazr.utils.jdbc.Transaction getConnection(com.qwazr.utils.IOUtils.CloseableContext context, boolean autoCommit) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getConnection
public com.qwazr.utils.jdbc.Transaction getConnection(com.qwazr.utils.IOUtils.CloseableContext context, boolean autoCommit, int transactionIsolation) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getPoolNumActive
public java.lang.Integer getPoolNumActive()The current number of active connections that have been allocated from this connection pool.- Returns:
- the current number of active connections
-
getPoolNumIdle
public java.lang.Integer getPoolNumIdle()The current number of idle connections that are waiting to be allocated from this connection pool.- Returns:
- the current number of idle connections
-