473,767 Members | 1,627 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 69102
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:currentS chema=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:currentS chema=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:currentS chema=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:currentS chema=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:currentS chema=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:currentS chema=MySchema"
It doesn't work?
sorry, correct url is:
"jdbc:db2://mserver:50007/MYDB7T:currentS chema=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:currentS chema=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:currentS chema=MySchema"
It doesn't work?

sorry, correct url is:
"jdbc:db2://mserver:50007/MYDB7T:currentS chema=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
7085
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 have to set ORACLE_HOME environment variable and CLASSPATH, but I have no idea how ?????????
1
2987
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 required for type 2 driver and what driver class files required ? Its very urgent to me please reply. Ajay
4
6346
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 found that it was shifted three Bytes to the left, i.e. 4 becomes hex 4000000 which is 67108864 in decimal base. This means that the value written and the value read sometimes do not match, which is of course inacceptable for all real world...
0
3083
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 on Windows 2000 machines. I configured a connection pool data source using type 4 for a local test environment in WSAD 5.1.x, and a connection pool data source on the WebSphere Server too. Both data sources are accessing the same database.
2
3760
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 the DB2 server). " Wht does it mean by "local" application performance? In type 2 mode, it is a pre-requisite that all the databases that the application running at the client need to be cataloged (through CCA or otherwise) on the client; Most...
1
1795
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 database manager loads? Is it configurable on the database server side so I could switch between different JDBC driver types, i.e. 2 and 4? I am on DB2 8.1.4 AIX and Linux. Thanks,
0
1245
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. The impact on the average user depends on how you got your .jar file. If you downloaded a binary version from http://jdbc.postgresql.org/ then you will see no change. This website will remain the official place for distributing the driver and...
11
9327
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 SAMPLE database. (This query works fine from within 'Control Center'...there is data in this table, etc.)
1
8803
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: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'COM.ibm.db2.jdbc.app.DB2Driver' for connect URL...
0
9571
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10013
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9960
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9841
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8838
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3930
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.