469,282 Members | 1,938 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

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

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
7 67047
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
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
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
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
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
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
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.

Similar topics

1 post views Thread by Axel Dachtler | last post: by
2 posts views Thread by Raquel | last post: by
1 post views Thread by eugene | last post: by
reply views Thread by Kris Jurka | last post: by
11 posts views Thread by David H. Cook | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.