When connecting to a DB2 database with Oracle SQL Developer, is there a way to specify my schema in the connection properties so that I'm always aimed where I want to be?
1 Answer
I don't know how Oracle SQL Developer works, but at least the JDBC driver for DB2 has the option to specify the schema in the connection string, like:
jdbc:db2://server:50000/MYDB:currentSchema=MySchema;
If you can manually change the connection string that OSD is using, then perhaps you can add that option in.
2 Comments
Frantumn
Thanks! That's something I never thought of, and it seemed to work. For those wondering how this can be done in oracle while accessing a DB2 Database: you have 3 fields on the connection properties... HostName: Port: Database: In the database field, put the name followed by :currentSchema=SchemaName; The string will look something like this... mydatabasename:currentSchema=myschemaname; Cheers
Sun
I notice if the schema name matches your user name, you don't have to explicitly include the schema name with your SQL statement. I only say this because you can't always explicitly set the connection string (e.g. using Oracle SQL Developer to connect to DB2 database)