ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Vissers <Jan.Viss...@cumquat.nl>
Subject Re: Oracle scheme
Date Wed, 31 Aug 2005 14:44:46 GMT
Ok, I think my knowledge of Oracle is getting in the way here. How is 
creating a synonym any harder than alter session statements. More than 
that, by using appropriate granting/synonyms structures in Oracle - you 
can have more secure data paths.

You can even use Oracle's own dictionary to have the 'create synonyms' 
statements generated for you, like (in SQL*Plus):

SQL> select 'create synonym '||table_name||' for USER01.'||table_name||';'
  2  from   user_tab_privs_recd
  3  where  grantor = 'USER01';

'CREATESYNONYM'||TABLE_NAME||'FORUSER01.'||TABLE_NAME||';'
--------------------------------------------------------------------------------

create synonym T_ALARM_BELL for USER01.T_ALARM_BELL;
create synonym T_ALARM_BAND for USER01.T_ALARM_BAND;
create synonym T_ALARM_SIGN for USER01.T_ALARM_SIGN;


Copy & Paste results

SQL> create synonym T_ALARM_BELL for USER01.T_ALARM_BELL;

Synonym created.

SQL> create synonym T_ALARM_BAND for USER01.T_ALARM_BAND;

Synonym created.

SQL> create synonym T_ALARM_SIGN for USER01.T_ALARM_SIGN;

Synonym created.


IMO: Not only a matter of taste.

Provided of course that user01 has granted rights to user02

Koka wrote:

> I have used kind of 'login trigger' approach - in fact I extended 
> datasource I were using to add execution of
> alter session set current_schema = "USER"
> statement to getConnection method.
> Found it easier then creating sysnonyms
>
> >I guess it's a matter of taste..
> Agree.
>
>
>

-- 
Cumquat Information Technology
De Dreef 19
3706 BR Zeist
T +31 (0)30 - 6940490
F +31 (0)10 - 6940499
http://www.cumquat.nl

Jan.Vissers@cumquat.nl
M +31 6 5 11 169 556



Mime
View raw message