What is the correct syntax or what are the correct steps for creating a schema in DB2 using JDBC?
When running create schema test1
or create schema test1 authorization db2admin
as db2admin, I consistently get DB2 SQL Error: SQLCODE=-552, SQLSTATE=42502, SQLERRMC=DB2ADMIN;CREATE SCHEMA, DRIVER=3.64.106
The exact same command works fine using the DB2 command-line tools.
I found it.
It turns out that for some reason DB2 Express-C does not grant the DBADM privilege to db2admin by default.
This can be fixed by connecting to the DB and then issuing
GRANT DBADM ON DATABASE to db2admin
Thanks Ian Bjorhovde for providing the inspiration spark!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With