On 2023-09-03 20:19:44 -0400, Amn Ojee Uw wrote:
> I see now, any suggestions as work around in JDBC?
Implement the functionality in Java.
You could do it directly:
execute
SELECT 'CREATE DATABASE jme_test_database' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname =
'jme_test_database')
read the result
for each row returned
execute it as SQL
But that would be silly.
Instead you would do it like this:
execute
SELECT datname FROM pg_database WHERE datname = 'jme_test_database'
read the result
if the result is empty:
execute
CREATE DATABASE jme_test_database'
hp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"