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 Database
addPostgresDatabase
(AoservConnector conn, Database.Name name, Server.Name postgresServer, DomainName server, User.Name datdba, String encoding, boolean enablePostgis) Adds aDatabase
to aHost
.static void
addPostgresDatabase
(SimpleAoservClient aoClient, Database.Name name, Server.Name postgresServer, String server, User.Name datdba, String encoding, boolean enablePostgis) Adds aDatabase
to 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 aDatabase
to aHost
.- Parameters:
aoClient
- theSimpleAoservClient
to 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 administratorUser
encoding
- the encoding to useenablePostgis
- enables PostGIS on the database- Throws:
IOException
SQLException
-
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 aDatabase
to aHost
.- Parameters:
conn
- theAoservConnector
to 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 administratorUser
encoding
- the encoding to useenablePostgis
- enables PostGIS on the database- Returns:
- the new
Database
- Throws:
IOException
SQLException
-