Changes in ServerSocket and added SQL queries of postgres