I can assure you can create more than one database in the same server in Postgres. We have a lot of customers doing this and this is how some of us work locally (with multiple databases).
Can you please share your datasource url configuration?
You asked for connecting to more than one database on the same server. The database name is the name that comes after the port. i.e. jdbc:postgresql://localhost:5432/<databaseName>.