If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > JDBC Connectivity to DB2 using Schema name

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-03-06, 03:55
Shefu Shefu is offline
Registered User
 
Join Date: Apr 2005
Posts: 127
JDBC Connectivity to DB2 using Schema name

Hi,


1. How could i connect to DB2 using schema name as a parameter. kindly provide me examples or relevent links
2. DB2 variables are non-case sensitive. Is there any option to make it case sensitive(like configurable option or installation option)

Thanks,
Sn
Reply With Quote
  #2 (permalink)  
Old 01-03-06, 06:51
przytula przytula is offline
Registered User
 
Join Date: Nov 2004
Posts: 374
schema

do you mean : set current schema xxxxx ??
what would be the purpose ? not qualifying the tablenames ?
__________________
Best Regards, Guy Przytula
DB2/ORA/SQL Services
DB2 DBA & Advanced DBA Certified
DB2 Dprop Certified
http://users.skynet.be/przytula/dbss.html
Reply With Quote
  #3 (permalink)  
Old 01-03-06, 07:43
Shefu Shefu is offline
Registered User
 
Join Date: Apr 2005
Posts: 127
Hi,

I want to connect to DB2 database via JDBC, is it possible to connect using schema name.. ie., is there any provisions to provide schema name in the connection parameters.

regards
Sn

Last edited by Shefu; 01-03-06 at 07:52.
Reply With Quote
  #4 (permalink)  
Old 01-03-06, 08:21
Shefu Shefu is offline
Registered User
 
Join Date: Apr 2005
Posts: 127
Hi,

I tried ur set schema option, it works fine for me.

thanks a lot

cheers
sn
Reply With Quote
  #5 (permalink)  
Old 01-04-06, 04:00
Wim Wim is offline
Registered User
 
Join Date: Nov 2004
Posts: 1,279
Quote:
Originally Posted by Shefu
2. DB2 variables are non-case sensitive. Is there any option to make it case sensitive(like configurable option or installation option)
Don't know what you exactly mean with "variables", but if you mean database objects (table, column, ..) names, you can place the names between double quotes "", otherwise DB2 will convert them automatically to UPPERCASE.
create table Schemanm.TestTable1 (
Field1 INT not null);
internally, DB2 will interpret this as:
create table SCHEMANM.TESTTABLE1 (
FIELD1 INT not null);

create table "Schemanm"."TestTable2" (
"Field1" INT not null);
internally, DB2 will interpret this as:
create table Schemanm.TestTable2 (
Field1 INT not null);

SELECT * FROM Schemanm.TestTable1;
SELECT * FROM SchemaNm.TESTTable1;
SELECT * FROM SCHEMANM.TESTTABLE1;
SELECT * FROM "SCHEMANM"."TESTTABLE1";
will all work.

SELECT * FROM Schemanm.TestTable1;
will not work.

Only
SELECT * FROM "Schemanm"."TestTable2";
will work.
__________________
With kind regards . . . . . SQL Server 2000/2005/2008/2008 R2 Earned beers: 16
Wim
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On