I am developing a SaaS and I am in the database part, what I want to do is create a database in postgresql for each client that registers but I do not know how to create them from java since the code that I have is the next:
CREATE DATABASE "Inventarios"
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default
LC_COLLATE = 'Spanish_Mexico.1252'
LC_CTYPE = 'Spanish_Mexico.1252'
CONNECTION LIMIT = -1;
However I'm not sure if that way I should work because I can not execute it because in the connection string it asks for the name of the database and that is what is not yet created, I also found information regarding create it using .bat files in windows but I do not know how to do it in linux