WebSphere Application Server - Users Accessing DB

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > January 2004 > Users Accessing DB





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Users Accessing DB
Sudhakar

2004-01-19, 2:54 pm

Hi All,
I have a problem. My applicatoin currently talks to the database using
a XADataSource with one user name and password. And i wanted to restrict
the user access to certain tables. Is there any way to do that. I mean
can i have one datasource which takes more than one user name
getDataSource("user1","password1"). and how will i configure it in the
Application Server. I know i can restrict users in the DB Level. Is
there a way to map it in the application Server level (i.e. connect to
the database as logged in user or soemthing like that).

My environment is
OS : Win2K
App sErver: WAS 5.1
Database : DB2 8.1.5

Thnx in Advance
Sudhakar

Ken Hygh

2004-01-20, 12:08 am

Sudhakar wrote:
quote:

> Hi All,
> I have a problem. My applicatoin currently talks to the database using
> a XADataSource with one user name and password. And i wanted to restrict
> the user access to certain tables. Is there any way to do that. I mean
> can i have one datasource which takes more than one user name
> getDataSource("user1","password1"). and how will i configure it in the
> Application Server. I know i can restrict users in the DB Level. Is
> there a way to map it in the application Server level (i.e. connect to
> the database as logged in user or soemthing like that).
>
> My environment is
> OS : Win2K
> App sErver: WAS 5.1
> Database : DB2 8.1.5
>
> Thnx in Advance
> Sudhakar
>



You'd have to write code to enforce the restriction, there's no clean
way to do it using a DataSource.

Ken

Sudhakar

2004-01-21, 12:40 am

Hi Ken,
I've wriiten code to use the user name and password of the user logged
in to connect to the database. I'm able to get the connection properly
but when i try to do any sql it says

<username>.<tablename> not found

do i need to do anything special on the database side (i have the user
registered in the system. i've added the user also as a database user
and also as a schema to the database).

thnx
Sudhakar

Ken Hygh wrote:
quote:

> Sudhakar wrote:
>
>
> You'd have to write code to enforce the restriction, there's no clean
> way to do it using a DataSource.
>
> Ken
>



Ken Hygh

2004-01-21, 12:40 am

Sudhakar wrote:
quote:

> Hi Ken,
> I've wriiten code to use the user name and password of the user logged
> in to connect to the database. I'm able to get the connection properly
> but when i try to do any sql it says
>
> <username>.<tablename> not found
>
> do i need to do anything special on the database side (i have the user
> registered in the system. i've added the user also as a database user
> and also as a schema to the database).
>
> thnx
> Sudhakar
>



You may need to explicitly put the schema name into your SQL. By default
it is the current user.

Ken

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com