Class AbstractJdbcConnector

java.lang.Object
org.pgcodekeeper.core.database.base.jdbc.AbstractJdbcConnector
All Implemented Interfaces:
IJdbcConnector
Direct Known Subclasses:
ChJdbcConnector, MsJdbcConnector, PgJdbcConnector

public abstract class AbstractJdbcConnector extends Object implements IJdbcConnector
Abstract base class for JDBC database connectors. Provides common functionality for establishing database connections.
  • Method Details

    • getConnection

      public Connection getConnection() throws IOException
      Description copied from interface: IJdbcConnector
      Creates a new database connection using the parameters specified in the constructor. The caller is responsible for closing the connection.
      Specified by:
      getConnection in interface IJdbcConnector
      Returns:
      new database connection
      Throws:
      IOException - if the driver is not found or a database access error occurs
    • getUrl

      public String getUrl()
      Specified by:
      getUrl in interface IJdbcConnector
      Returns:
      connection string
    • getDbName

      public String getDbName()
      Specified by:
      getDbName in interface IJdbcConnector
      Returns:
      database name extracted from the connection URL