473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 68930
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Axel Dachtler | last post by:
Hello, my Java-program can't load the JDBC driver. I always get a java.lang.NoClassDefFoundError when I run it. The JDBC Driver is in the directory: C:\programs\ora92\jdbc\lib I think I...
1
by: Ajay | last post by:
Hi, Could some please tell me whether Microsoft provides Type 2 and Type 4 jdbc driver ? For Type 4 MS provides com.microsoft.jdbc.sqlserver.SQLServerDriver driver. What is the cofiguration...
4
by: Dani | last post by:
Hi everyone Description of the problem: Using a PreparedStatement to write down an integer (int) plus a timestamp for testing purposes. When read out again the integer looks very different. We...
0
by: Bing | last post by:
Hi, I am configuring the same DB2 v8.1 JDBC universal driver (db2jcc.jar and db2jcc_license_cisuz.jar) from DB2 SP5 fix pack under WSAD 5.1.x environment and WebSphere application Server 5.0.2...
2
by: Raquel | last post by:
Read this about the Universal JDBC Driver.... "In a Type 2 mode, the Universal JDBC driver provides local application performance gains (because it avoids using TCP/IP protocol to communicate to...
1
by: eugene | last post by:
Happy Christmas to all (who celebrate)! It's still not clear to me... when in a java stored procedure it says: conn = DriverManager.getConnection("jdbc:default:connection"); what driver DB2...
0
by: Kris Jurka | last post by:
The JDBC driver has been moved out of the main source tree to a gborg project. This change will only affect new major releases. The 7.4 series will continue to be maintained in the main tree. ...
11
by: David H. Cook | last post by:
Hi - I just installed the express-edition of DB2 server (on a Win-XP machine), and then I setup a client JDBC driver to access it. The query is a simple 'select * from EMPLOYEE' against their...
1
by: rpm45tech | last post by:
Hi everyone. I'm deveolping in Java with DB2 running on Win XP and everything was working ok but then I installed Vista Ultimate and the application stopped working. This is the exception showed: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.