Add postgresql jdbc driver
Adapt SQL queries to make them database independant