If I have an instance of a JDBC DB2 connection, how do I get the current schema?
Either a SQL statement would work, or just a JDBC method call.
Schema is a logical namespace that contains database objects such as tables, views, indexes, etc. Each schema belongs to one database, and each database has at least one schema. If not specified otherwise, the default schema in PostgreSQL is public.
The objects in a relational database are organized into sets called schemas. A schema is a collection of named objects that provides a logical classification of objects in the database. The first part of a schema name is the qualifier.
select current_schema
from sysibm.sysdummy1
;
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