My ideas for your questions:
1,2. You can apply JDBC or any object relational mapping framework (Hibernate, Open JPA, Eclipse Link...).
3,4 Yes, you're right... The main point is Heroku just provide you a Postgre service the way you deal with the service like you did in your localhost.