9.1

Connection to a vPostgres Database
with JDBC or psql 6
If you do not want to use the Data Director UI to manage your vPostgres database, you can instead connect
with JDBC or with psql.
Connecting with JDBC
The JDBC connection string has the following format.
jdbc:postgresql://{UUID}.
host_name
/
rdb_name
?user=<user name>
The curly brackets, {}, are part of the connection string and enclose the UUID.
For example, assume that you use JDBC to connect to a database with the following characteristics.
Database name
myDB
Host name
w1-devtest-22.dev.mycorp.com
UUID
d35f7ab1-d70e-4d98-c121-122f68e4ab60
User name
dbowner
You can use the following JDBC connection string.
jdbc:postgresql://{d35f7ab1-d70e-4d98-c121-122f68e4ab60}.w1-devtest-22.dev.mycorp.com/mydb?
user=dbowner
Connecting with psql
The psql connection string has the following format.
psql -h {UUID}.DB_Name_Service_IP -p 5432 -d DB_name -U db_user_name
For example, assume that you use psql to connect to a database with the following characteristics.
UUID
1234-5678-9012-3456
DB Name Service port
5432
DB Name Server IP
address
10.0.0.1
database user name
dbuser
You can use the following psql command to connect to the database.
$ psql -h {1234-5678-9012-3456}.10.0.0.1 -p 5432 -d myDB -U dbuser
Psql connects to myDB and prompts for the password, and logs you in. You can enter psql commands.
VMware, Inc.
25