Developing Applications with PostgreSQL on Solaris
Using PostgreSQL with Scripting Languages
- PHP
- Ruby
- Python
- Perl
- PL/pgSQL
Using PostgreSQL with C/C++
Using PostgreSQL with Java (JDBC driver)
Using Netbeans as IDE with PostgreSQL
Starting the DB
In SXDE 1/08, before starting to use PostgreSQL DB, execute the following command as root user:

In Console /usr/sbin/svcadm enable postgresql:version_82
You do not need to setup PostgreSQL data directory or create a postgres user as it is already created in Solaris OS. The above command will also start the PostgreSQL DB.
Additional Configuration
The pre-existing PostgreSQL SMF service is disabled by default. So, if you (as owner and single user of the machine) don't enable the SMF service, the default port won't be used. So you can start PostgreSQL on a non-default port also.
If you want a PostgreSQL instance that is owned and managed by you and runs on the default port, just call initdb as shown in the above section followed by pg_ctl start. If you need to enable the pre-existing PostgreSQL SMF service, and if you want to manage it from another user name, then you need to assign the necessary privileges.
Execute the following command just once:
| In Console $ usermod -P "Postgres Administration" <username> |
Adding a Connection
For using PostgresSQL DB in your application through NetBeans, you need to let NetBeans now the existence and authentication information of the DB. For this reason, you need to create a new DB connection from NetBeans IDE.
- Go to Service tab.
- Right click Databases and select New Connection.
- In the New Database Connection dialog select PostgreSQL as the DB.
- Enter the Driver name as org.postgresql.Driver if not present already.
- Provide the Database URL. postgres is the name of the DB.
- Enter user name and password (Default user name is postgres and password is an
empty string ''). - Click OK.
- Click Advanced tab and select the schema.
- Click OK.
Using Glassfish as Application Server with PostgreSQL
Create PostgreSQL Resource Pool
Create JDBC Resource
Using PostgreSQL JDBC Role - An Example BPEL Process