org.jasypt.hibernate.connectionprovider

## Class EncryptedPasswordC3P0ConnectionProvider

- Object
- - org.hibernate.connection.C3P0ConnectionProvider
  - - org.jasypt.hibernate.connectionprovider.EncryptedPasswordC3P0ConnectionProvider

- All Implemented Interfaces:
    org.hibernate.connection.ConnectionProvider

  Deprecated.
  Will be removed in 1.11. Package org.jasypt.hibernate.connectionprovider has been renamed as org.jasypt.hibernate3.connectionprovider.

      public final class EncryptedPasswordC3P0ConnectionProvider
      extends org.hibernate.connection.C3P0ConnectionProvider

  Extension of `C3P0ConnectionProvider` that allows the user to write the datasource configuration parameters in an encrypted manner in the `hibernate.cfg.xml` or `hibernate.properties` file

  The encryptable parameters are:

  - `connection.driver_class`
  - `connection.url`
  - `connection.username`
  - `connection.password`

  The name of the password encryptor (decryptor, in fact) will be set in property `hibernate.connection.encryptor_registered_name`. Its value must be the name of a `PBEStringEncryptor` object previously registered within `HibernatePBEEncryptorRegistry`.

  An example `hibernate.cfg.xml` file:

        <hibernate-configuration>

          <session-factory>

            <property name="connection.provider_class">org.jasypt.hibernate.connectionprovider.EncryptedPasswordC3P0ConnectionProvider</property>
            <property name="connection.encryptor_registered_name">stringEncryptor</property>
            <property name="connection.driver_class">org.postgresql.Driver</property>
            <property name="connection.url">jdbc:postgresql://localhost/mydatabase</property>
            <property name="connection.username">myuser</property>
            <property name="connection.password">ENC(T6DAe34NasW==)</property>
            <property name="c3p0.min_size">5</property>
            <property name="c3p0.max_size">20</property>
            <property name="c3p0.timeout">1800</property>
            <property name="c3p0.max_statements">50</property>
            ...

          </session-factory>

          ...

        </hibernate-configuration>

  Since:
    1.4
  Author:
    Daniel Fernández

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EncryptedPasswordC3P0ConnectionProvider()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `configure(Properties props)` Deprecated.

    - ### Methods inherited from class org.hibernate.connection.C3P0ConnectionProvider

      `close, closeConnection, getConnection`

    - ### Methods inherited from class Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EncryptedPasswordC3P0ConnectionProvider

          public EncryptedPasswordC3P0ConnectionProvider()

      Deprecated.

  - ### Method Detail

    - #### configure

          public void configure(Properties props)

      Deprecated.
      Specified by:
        `configure` in interface `org.hibernate.connection.ConnectionProvider`
      Overrides:
        `configure` in class `org.hibernate.connection.C3P0ConnectionProvider`

Copyright © 2019 The JASYPT team. All rights reserved.