Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sastry.m.s@gmail.com - 16 Mar 2006 08:05 GMT
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.
Mark A - 16 Mar 2006 08:13 GMT
> Hi,
>
[quoted text clipped - 6 lines]
> 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
sastry.m.s@gmail.com - 16 Mar 2006 10:53 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.