Apache Derby : create several instances.  
Author Message
Mr. X.





PostPosted: 2008-3-11 12:29:00 Top

java-programmer, Apache Derby : create several instances. Hello.
I am using Apache derby database (Client network).
I see that when I create table it is created on an instance APP
(I don't know if instance is the correct word. sorry of my English).
I see that there are other instances (NULLID, SQLJ, SYS, etc).
Can I create an instance of my own in derby database, and how can I do that
?
(One instance may be used for repository, another for Datawarehouse, ...)

Another thing :
If I create several databases for te above reason (repository may be on
another db), how can I join them, when I am connected to database1, and want
to run a query that join both tables from database1 and database2 ?

Thanks :)


 
Thomas Kellerer





PostPosted: 2008-3-11 15:37:00 Top

java-programmer >> Apache Derby : create several instances. Mr. X., 11.03.2008 05:28:
> Hello.
> I am using Apache derby database (Client network).
> I see that when I create table it is created on an instance APP
> (I don't know if instance is the correct word. sorry of my English).
> I see that there are other instances (NULLID, SQLJ, SYS, etc).
> Can I create an instance of my own in derby database, and how can I do that
> ?
> (One instance may be used for repository, another for Datawarehouse, ...)

You are talking about a SCHEMA (not an instance).

You can create a new schema using the CREATE SCHEMA statement:
http://db.apache.org/derby/docs/10.3/ref/rrefsqlj31580.html

> Another thing :
> If I create several databases for te above reason (repository may be on
> another db), how can I join them, when I am connected to database1, and want
> to run a query that join both tables from database1 and database2 ?

No problem, you can reference tables in a different schema see:

http://db.apache.org/derby/docs/10.3/ref/rreftablename.html
http://db.apache.org/derby/docs/10.3/ref/rrefschemaname.html

Thomas
 
Mr. X.





PostPosted: 2008-3-14 12:01:00 Top

java-programmer >> Apache Derby : create several instances. After I did create schema ...
How can create table on specific schema (it always created on schema APP by
default) ?

Thanks :)


 
 
Thomas Kellerer





PostPosted: 2008-3-14 15:36:00 Top

java-programmer >> Apache Derby : create several instances. Mr. X., 14.03.2008 05:01:
> After I did create schema ...
> How can create table on specific schema (it always created on schema APP by
> default) ?

http://db.apache.org/derby/docs/10.3/ref/rrefsqlj32268.html