1

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
  • I know once connected, I can type /*sqldev:stmt*/SET CURRENT SCHEMA= <schema> and that will allow me to use the schema, but I'm looking to bypass that all together. Commented May 10, 2012 at 14:28

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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
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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.