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 class  JdbcConnector.ConnectionPool  
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.lang.String driver  
    JdbcConnector.ConnectionPool pool  
    java.lang.String url  
    java.lang.String username  

    Fields inherited from class com.qwazr.library.AbstractPasswordLibrary

    password

    Fields inherited from class com.qwazr.library.AbstractLibrary

    libraryManager
  • Constructor Summary

    Constructors 
    Constructor Description
    JdbcConnector()  
  • Method Summary

    Modifier and Type Method Description
    void close()  
    com.qwazr.utils.jdbc.Transaction getConnection​(com.qwazr.utils.IOUtils.CloseableContext context)  
    com.qwazr.utils.jdbc.Transaction getConnection​(com.qwazr.utils.IOUtils.CloseableContext context, boolean autoCommit)  
    com.qwazr.utils.jdbc.Transaction getConnection​(com.qwazr.utils.IOUtils.CloseableContext context, boolean autoCommit, int transactionIsolation)  
    java.lang.Integer getPoolNumActive()
    The current number of active connections that have been allocated from this connection pool.
    java.lang.Integer getPoolNumIdle()
    The current number of idle connections that are waiting to be allocated from this connection pool.
    void load()  

    Methods inherited from class com.qwazr.library.AbstractLibrary

    load

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • load

      public void load()
      Specified by:
      load in interface com.qwazr.library.LibraryInterface
    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.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