All Implemented Interfaces:
Platform

public class PostgreSqlPlatform extends PlatformImplBase
The platform implementation for PostgresSql.
Version:
$Revision: 231306 $
  • Field Details

  • Constructor Details

    • PostgreSqlPlatform

      public PostgreSqlPlatform()
      Creates a new platform instance.
  • Method Details

    • getName

      public String getName()
      Returns the name of the database that this platform is for.
      Returns:
      The name
    • createDatabase

      public void createDatabase(String jdbcDriverClassName, String connectionUrl, String username, String password, Map parameters) throws DatabaseOperationException, UnsupportedOperationException
      Creates the database specified by the given parameters. Please note that this method does not use a data source set via Platform.setDataSource(DataSource) because it is not possible to retrieve the connection information from it without establishing a connection.
      The given connection url is the url that you'd use to connect to the already-created database.
      On some platforms, this method suppurts additional parameters. These are documented in the manual section for the individual platforms.
      Specified by:
      createDatabase in interface Platform
      Overrides:
      createDatabase in class PlatformImplBase
      Parameters:
      jdbcDriverClassName - The jdbc driver class name
      connectionUrl - The url to connect to the database if it were already created
      username - The username for creating the database
      password - The password for creating the database
      parameters - Additional parameters relevant to database creation (which are platform specific)
      Throws:
      DatabaseOperationException
      UnsupportedOperationException
    • dropDatabase

      public void dropDatabase(String jdbcDriverClassName, String connectionUrl, String username, String password) throws DatabaseOperationException, UnsupportedOperationException
      Drops the database specified by the given parameters. Please note that this method does not use a data source set via Platform.setDataSource(DataSource) because it is not possible to retrieve the connection information from it without establishing a connection.
      Specified by:
      dropDatabase in interface Platform
      Overrides:
      dropDatabase in class PlatformImplBase
      Parameters:
      jdbcDriverClassName - The jdbc driver class name
      connectionUrl - The url to connect to the database
      username - The username for creating the database
      password - The password for creating the database
      Throws:
      DatabaseOperationException
      UnsupportedOperationException
    • setObject

      protected void setObject(PreparedStatement statement, int sqlIndex, org.apache.commons.beanutils.DynaBean dynaBean, SqlDynaProperty property) throws SQLException
      Sets a parameter of the prepared statement based on the type of the column of the property.
      Overrides:
      setObject in class PlatformImplBase
      Parameters:
      statement - The statement
      sqlIndex - The index of the parameter to set in the statement
      dynaBean - The bean of which to take the value
      property - The property of the bean, which also defines the corresponding column
      Throws:
      SQLException