473,396 Members | 1,942 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,396 software developers and data experts.

How can i connect to tables created in a schema with a username different from the schema name?

Hi,
I have tables created in my DB2 database created under a schema. Now i
want to get connected to these tables with a username different from
this schema name from my java application. When i give the user name in
my JDBC connection parameters, Its appending this username to the
tables like username.tablename and thorws exceptions as the tables does
not exists. How can i resolve this?? Help me!!!
Thanks in advance,
Sastry.

Mar 16 '06 #1
2 1708
<sa********@gmail.com> wrote in message
news:11*********************@j52g2000cwj.googlegro ups.com...
Hi,

I have tables created in my DB2 database created under a schema. Now i
want to get connected to these tables with a username different from
this schema name from my java application. When i give the user name in
my JDBC connection parameters, Its appending this username to the
tables like username.tablename and thorws exceptions as the tables does
not exists. How can i resolve this?? Help me!!!
Thanks in advance,
Sastry.


Any of these should work:

1. Use the set schema statement
2. Fully qualify the table names in your code (select from
schema.table-name)
3. create an alias for each table
Mar 16 '06 #2
Hi,

Thanks for the reply. I resolved the issue in the following manner.
I have given currentSchema attribute to my database url while getting
the JDBC connetion.

The syntax is
jdbc:db2://<host>:<port>/<DB>;currentSchema=<schema name>

Thanks
Sastry

Mar 16 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
0
by: Mike Chirico | last post by:
I found the following interesting and wanted to pass it along Reference (TIP 12): http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download Connect and Select from Java //...
0
by: Mike | last post by:
Hello, I'm trying to understand how to map hierarchical XML data to relational database tables, but I seem to be missing something. I'm not a database expert, but I know the basics. XML seems...
8
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
3
by: athos | last post by:
Hi guys, please help. What I did is : Step1. create a Database named , it's default owner is Step2. create a User in Database named , which maps to the Login on this Database Server, it's a...
2
by: David++ | last post by:
Dear List, Is it possible to have a schema with tables of the same name? I need to build an XML document based on the following schema - <?xml version="1.0" encoding="utf-8"?> <xs:schema...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
1
by: iancarr00 | last post by:
Ok, So far I have been pulling my hair out! I can't get dreamweaver mx8 (on mac osx) to access my database, which is sat on a streamline.net shared windows server. I have acsess to my database...
2
by: harrysdu | last post by:
May be someone has asked similar question here. If so, please point me to the link. one of our Access application has many linked tables. For testing purpose, I would like get it connected to the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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...

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.