By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,742 Members | 793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,742 IT Pros & Developers. It's quick & easy.

DB2 V 9.1: JDBC driver: How to set default schema

P: n/a
Using the IBM Universal JDBC (Type 4) driver;
Can one specify a default schema as part of the url?
Some application servers do not allow sending a default sql command
upon connection, so I can't rely on 'set schema xyz', hence the need
to set the default via the jdbc url.

Thanks.
natG

Apr 17 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
natG wrote:
Using the IBM Universal JDBC (Type 4) driver;
Can one specify a default schema as part of the url?
Some application servers do not allow sending a default sql command
upon connection, so I can't rely on 'set schema xyz', hence the need
to set the default via the jdbc url.
One of these days I'll have to learn this stuff...
I thought there are so called "connection properties". (?)
Hoping for Knut (not the bear) to come to the rescue...

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Apr 17 '07 #2

P: n/a
Hello.

Search for currentSchema word at
http://publib.boulder.ibm.com/infoce...c/rjvdsprp.htm

Sincerely,
Mark B.

On Apr 17, 10:17 pm, natG <natgr...@gmail.comwrote:
Using the IBM Universal JDBC (Type 4) driver;
Can one specify a default schema as part of the url?
Some application servers do not allow sending a default sql command
upon connection, so I can't rely on 'set schema xyz', hence the need
to set the default via the jdbc url.

Thanks.
natG

Apr 18 '07 #3

P: n/a
Thank you, Serge and Mark. I have seen that page before posting here.
The problem is that when defining a datasource xml, I cannot specify
properties.
I am only allowed 1) URL. 2) Logon & password. Now, some other vendors
jdbc driver allows me to specify these properties as part of the url
logon, and although the page Mark posted above alludes to a 'url
string', it does not specify any details.

For example. One of my jdbc url's is: jdbc:db2://mserver:50007/MYDB7T.
I would like to use something like: jdbc:db2://mserver:50007/
MYDB7T:currentSchema=MySchema.

Thanks
nat

Apr 18 '07 #4

P: n/a
Ray
On Apr 18, 12:04 pm, natG <natgr...@gmail.comwrote:
Thank you, Serge and Mark. I have seen that page before posting here.
The problem is that when defining a datasource xml, I cannot specify
properties.
I am only allowed 1) URL. 2) Logon & password. Now, some other vendors
jdbc driver allows me to specify these properties as part of the url
logon, and although the page Mark posted above alludes to a 'url
string', it does not specify any details.

For example. One of my jdbc url's is: jdbc:db2://mserver:50007/MYDB7T.
I would like to use something like: jdbc:db2://mserver:50007/
MYDB7T:currentSchema=MySchema.

Thanks
nat
There should be a section of the dialog where you can add ad hoc
properties and values. I believe that's what they're referring to.

Apr 18 '07 #5

P: n/a
On Apr 18, 9:04 pm, natG <natgr...@gmail.comwrote:
Thank you, Serge and Mark. I have seen that page before posting here.
The problem is that when defining a datasource xml, I cannot specify
properties.
I am only allowed 1) URL. 2) Logon & password. Now, some other vendors
jdbc driver allows me to specify these properties as part of the url
logon, and although the page Mark posted above alludes to a 'url
string', it does not specify any details.

For example. One of my jdbc url's is: jdbc:db2://mserver:50007/MYDB7T.
I would like to use something like: jdbc:db2://mserver:50007/
MYDB7T:currentSchema=MySchema.

Thanks
nat
according to
http://publib.boulder.ibm.com/infoce...c/tjvjcccn.htm
this url should give you ability to set default schema:
"jdbc:db2://mserver:50007/MYDB7T:currentSchema=MySchema"
It doesn't work?

Apr 18 '07 #6

P: n/a
On Apr 18, 9:54 pm, 4.s...@mail.ru wrote:
On Apr 18, 9:04 pm, natG <natgr...@gmail.comwrote:
Thank you, Serge and Mark. I have seen that page before posting here.
The problem is that when defining a datasource xml, I cannot specify
properties.
I am only allowed 1) URL. 2) Logon & password. Now, some other vendors
jdbc driver allows me to specify these properties as part of the url
logon, and although the page Mark posted above alludes to a 'url
string', it does not specify any details.
For example. One of my jdbc url's is: jdbc:db2://mserver:50007/MYDB7T.
I would like to use something like: jdbc:db2://mserver:50007/
MYDB7T:currentSchema=MySchema.
Thanks
nat

according tohttp://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2....
this url should give you ability to set default schema:
"jdbc:db2://mserver:50007/MYDB7T:currentSchema=MySchema"
It doesn't work?
sorry, correct url is:
"jdbc:db2://mserver:50007/MYDB7T:currentSchema=MySchema;"

Apr 18 '07 #7

P: n/a
On Apr 18, 1:58 pm, 4.s...@mail.ru wrote:
On Apr 18, 9:54 pm, 4.s...@mail.ru wrote:
On Apr 18, 9:04 pm, natG <natgr...@gmail.comwrote:
Thank you, Serge and Mark. I have seen that page before posting here.
The problem is that when defining a datasource xml, I cannot specify
properties.
I am only allowed 1) URL. 2) Logon & password. Now, some other vendors
jdbc driver allows me to specify these properties as part of the url
logon, and although the page Mark posted above alludes to a 'url
string', it does not specify any details.
For example. One of my jdbc url's is: jdbc:db2://mserver:50007/MYDB7T.
I would like to use something like: jdbc:db2://mserver:50007/
MYDB7T:currentSchema=MySchema.
Thanks
nat
according tohttp://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2....
this url should give you ability to set default schema:
"jdbc:db2://mserver:50007/MYDB7T:currentSchema=MySchema"
It doesn't work?

sorry, correct url is:
"jdbc:db2://mserver:50007/MYDB7T:currentSchema=MySchema;"
Bravo! NOW it works! It was the semicolon at the end I was missing.
Thank you much!
nat

Apr 18 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.