In these days I'm involved with a project using a PostgreSQL database. This is the first time I'm working with PGSQL, So I could learn some new features in PGSQL. One of the requirement I needed while coding is to find an easy way to get the auto generated primary key value when inserting a data record to the PGSQL database. I could find several ways to do that and one of method I found was really easy way. Those methods I found are described in this post.
First Method:
public int insertData( String name, String address, String tp_no)
{
int insertedKey = 0;