Class AddPostgresDatabase
java.lang.Object
com.aoindustries.aoserv.examples.postgres.AddPostgresDatabase
Before creating a new PostgreSQL database, please make sure that a
User
has been added for use as the Database Administrator (DBA).
The possible values for encoding may be found in the postgres_encodings table.
- Author:
- AO Industries, Inc.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic DatabaseaddPostgresDatabase(AoservConnector conn, Database.Name name, Server.Name postgresServer, DomainName server, User.Name datdba, String encoding, boolean enablePostgis) Adds aDatabaseto aHost.static voidaddPostgresDatabase(SimpleAoservClient aoClient, Database.Name name, Server.Name postgresServer, String server, User.Name datdba, String encoding, boolean enablePostgis) Adds aDatabaseto aHost.
-
Method Details
-
addPostgresDatabase
public static void addPostgresDatabase(SimpleAoservClient aoClient, Database.Name name, Server.Name postgresServer, String server, User.Name datdba, String encoding, boolean enablePostgis) throws IOException, SQLException Adds aDatabaseto aHost.- Parameters:
aoClient- theSimpleAoservClientto usename- the name of the database to addpostgresServer- the name of the PostgreSQL serverserver- the hostname of the server to add the database todatdba- the username of the database administratorUserencoding- the encoding to useenablePostgis- enables PostGIS on the database- Throws:
IOExceptionSQLException
-
addPostgresDatabase
public static Database addPostgresDatabase(AoservConnector conn, Database.Name name, Server.Name postgresServer, DomainName server, User.Name datdba, String encoding, boolean enablePostgis) throws IOException, SQLException Adds aDatabaseto aHost.- Parameters:
conn- theAoservConnectorto usename- the name of the database to addpostgresServer- the name of the PostgreSQL serverserver- the hostname of the server to add the database todatdba- the username of the database administratorUserencoding- the encoding to useenablePostgis- enables PostGIS on the database- Returns:
- the new
Database - Throws:
IOExceptionSQLException
-
