db link / VIEWS

View: New views
3 Messages — Rating Filter:   Alert me  

db link / VIEWS

by Danny Mwiinga :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi there,

 

I have two separate derby databases on the same machine and on one of them, I only have read rights while I have all rights on the other. Is it at all possible for me to create either a database link between the two so that I can query one of the databases or is it possible for me create VIEWS on the db where I have all the rights so that I can query the db where I only have read rights?

 

Any help will be greatly appreciated.

 

Thanks,

 

Danny

 


Danny Mwiinga

Emunio Consulting Ltd

Registered Office:

The Bix Building

Smith Centre

The Fairmile

Henley on Thames

Oxfordshire

RG9 6AB

Registered in England and Wales no 4857520

( Office:  +44 (0) 8702 408874

( Fax:     +44 (0) 1491 635755

* Email:   danny.mwiinga@... 

:  Web:   www.emunioconsulting.com

 



**********************************************************************

 

IMPORTANT NOTICE

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this email and you must notify the sender immediately and delete the email. Please note that any views or opinions presented in this email are those of the author and do not necessarily represent those of Emunio Consulting Ltd.

 

This email has been scanned for viruses, however, it is not guaranteed to be virus free and Emunio Consulting Ltd accepts no responsibility for any consequences of passing on any virus. Emunio may monitor all incoming and outgoing emails in line with current legislation.

 

Emunio Consulting Ltd is a registered company in England and Wales (Company Registration Number 4857520) and its registered address is The Bix Building, Smith Centre, The Fairmile, Henley on Thames, Oxfordshire, RG9 6AB

 

**********************************************************************

 


Re: db link / VIEWS

by Rick Hillegas-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Danny,

I may not be understanding your question, so please bear with me. If
what you need to do is read data from database B while you are connected
to database A, then you can use a view wrapped around a table function.
The table function would open a connection to database B and run a query
there. The view would make it simple to invoke the table function. Table
functions are discussed here:
http://db.apache.org/derby/docs/10.5/devguide/devguide-single.html#cdevspecialtabfuncs 
Also, see the following white paper, which goes into greater detail and
shows you how to wrap a view around a table function in order to
simplify your SQL:
http://developers.sun.com/javadb/reference/whitepapers/index.jsp

Hope this helps,
-Rick

Danny Mwiinga wrote:

>
> Hi there,
>
>  
>
> I have two separate derby databases on the same machine and on one of
> them, I only have read rights while I have all rights on the other. Is
> it at all possible for me to create either a database link between the
> two so that I can query one of the databases or is it possible for me
> create VIEWS on the db where I have all the rights so that I can query
> the db where I only have read rights?
>
>  
>
> Any help will be greatly appreciated.
>
>  
>
> Thanks,
>
>  
>
> Danny
>
>  
>
> * *
>
> *Danny Mwiinga*
>
> *Emunio Consulting Ltd*
>
> Registered Office:
>
> The Bix Building
>
> Smith Centre
>
> The Fairmile
>
> Henley on Thames
>
> Oxfordshire
>
> RG9 6AB
>
> Registered in England and Wales no 4857520
>
> ( Office:  +44 (0) 8702 408874
>
> ( Fax:     +44 (0) 1491 635755
>
> * Email:   danny.mwiinga@...
> <mailto:danny.mwiinga@...>
>
> :  Web:   www.emunioconsulting.com <http://www.emunioconsulting.com/>
>
>  
>
>
>
> **********************************************************************
>
>  
>
> IMPORTANT NOTICE
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed.  If you are not the intended recipient you must not
> use, disclose, distribute, copy, print, or rely on this email and you
> must notify the sender immediately and delete the email. Please note
> that any views or opinions presented in this email are those of the
> author and do not necessarily represent those of Emunio Consulting Ltd.
>
>  
>
> This email has been scanned for viruses, however, it is not guaranteed
> to be virus free and Emunio Consulting Ltd accepts no responsibility
> for any consequences of passing on any virus. Emunio may monitor all
> incoming and outgoing emails in line with current legislation.
>
>  
>
> Emunio Consulting Ltd is a registered company in England and Wales
> (Company Registration Number 4857520) and its registered address is
> The Bix Building, Smith Centre, The Fairmile, Henley on Thames,
> Oxfordshire , RG9 6AB
>
>  
>
> **********************************************************************
>
>  


Re: db link / VIEWS

by Dag H. Wanvik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Danny Mwiinga <danny.mwiinga@...> writes:

> Hi there,
>
>  
>
> I have two separate derby databases on the same machine and on one of
> them, I only have read rights while I have all rights on the other. Is
> it at all possible for me to create either a database link between the
> two so that I can query one of the databases or is it possible for me
> create VIEWS on the db where I have all the rights so that I can query
> the db where I only have read rights?

Yes, you can use Table functions for this purpose. Cf example here:

http://db.apache.org/derby/docs/10.5/devguide/cdevspecialtfexample.html

Using this you can perform queries againt the database you do have
write access to, as well as against the additional one, and even do
joins between the two.

See also
http://db.apache.org/derby/docs/10.5/devguide/cdevspecialtabfuncs.html

Dag