473,623 Members | 2,433 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.tablen ame 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 1722
<sa********@gma il.com> wrote in message
news:11******** *************@j 52g2000cwj.goog legroups.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.tablen ame 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>;currentSch ema=<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
3036
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 write some PHP code which should, I think, be able to to auto create the tables. The SQL looks like this:
0
1687
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 // // mysql-connector-java-3.0.11-stable-bin.jar or later must be
0
2404
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 so much more intuitive to me, though. Anyway, let me make up an example: Say we have an address book, in XML format, that is to be uploaded by a customer and then mapped into relational database tables. I would start by creating an XML Schema...
8
6283
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 one-to-one relationship but on this occasion I must keep username/password details within a seperate table. Here's the basic specs and database schema: -------------------------------------------
3
15360
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 windows domain user. Step3. create a Schema in Database named , whose Schema Owner is User Step4. created two tables: . and .
2
1278
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 id="Recordlist" targetNamespace="http://tempuri.org/Recordlist.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/Recordlist.xsd" xmlns:mstns="http://tempuri.org/Recordlist.xsd"
12
6996
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 foreign Key relationship or does this always indicate some sort of underlying design flaw. Something that requires a re evaluation of the problem domain? The reason I ask is because in our application, the user can perform x
1
2610
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 through phpmyadmin. That is how i created the tables. However, I have been through lots of help sites and still can't get dreamweaver to see database to assess my tables. I have tried using other gui such as navicat and I can access my tables...
2
3742
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 test database. I found what the application really needs is the data source name, as long as you created the data source entry whose name matches that in the linked table, it doesn't matter what you entered for the TNS service name or user ID in...
0
8227
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
8165
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8613
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...
0
8469
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
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4074
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
2602
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
1
1778
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1473
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.