You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Néstor Boscán <ne...@tcs.com.ve> on 2007/09/10 02:08:37 UTC

How to restrict external connections

Hi
 
Is there a way to restrict external connection to a Derby Database?. I only
want the JVM to be able to connect to the Derby database and no other
external processes.
 
Regards,
 
Néstor Boscán

RE: How to restrict external connections

Posted by Néstor Boscán <ne...@gmail.com>.
YES!!! that answered my question. Thanks a lot.

Regards,

Néstor Boscán 

-----Mensaje original-----
De: Kristian.Waagan@Sun.COM [mailto:Kristian.Waagan@Sun.COM] 
Enviado el: Monday, September 10, 2007 4:27 AM
Para: Derby Discussion
Asunto: Re: How to restrict external connections

Néstor Boscán wrote:
> Hi
>  
> Is there a way to restrict external connection to a Derby Database?. I 
> only want the JVM to be able to connect to the Derby database and no 
> other external processes.

Hello,

Unless I have misunderstood, sounds like you simply want to use Derby
embedded. This is done by using org.apache.derby.jdbc.EmbeddedDriver and
specifying the connection URL as 'jdbc:derby:myDatabase[;create=true;...]'.
By default, no network server will be started and only the JVM is able to
access the database.

Note that 'myDatabase' can point to a database by using either a relative
path (relative to derby.system.home, or current working directory if it is
unset) or an absolute path.

Did that answer you question, or do you have any further requirements?


regards,
--
Kristian


>  
> Regards,
>  
> Néstor Boscán


Re: How to restrict external connections

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Néstor Boscán,

Yes, only one process at a time can access the Derby database files  
for any particular database. There's no inter-process mechanism to  
prevent corruption if multiple processes were to access the files.  
There is a mechanism to prevent multiple processes from accessing the  
database.

Craig

On Sep 10, 2007, at 10:51 PM, Néstor Boscán wrote:

> Hi Mamta thanks for the answer.
>
> So basically Derby will only be up in one JVM at a time. Correct?
>
> Regards,
>
> Néstor Boscán
>
> De: Mamta Satoor [mailto:msatoor@gmail.com]
> Enviado el: Tuesday, September 11, 2007 1:13 AM
> Para: Derby Discussion
> Asunto: Re: How to restrict external connections
>
> Néstor,
>
> If a tool like ij is started in a new JVM, then it will not be able  
> to connect to an embedded database which has been started by a  
> different JVM.
>
> HTH,
> Mamta
>
> On 9/10/07, Néstor Boscán <ne...@tcs.com.ve> wrote:
> Hi Kristian
>
> Thanks for the answer.
>
> So this means that if I open the database using the EmbeddedDriver  
> driver no
> one can access the database from an outside connection?. Includiing  
> tools
> like ij?
>
> Regards,
>
> Néstor Boscán
>
> -----Mensaje original-----
> De: Kristian.Waagan@Sun.COM [mailto:Kristian.Waagan@Sun.COM]
> Enviado el: Monday, September 10, 2007 4:27 AM
> Para: Derby Discussion
> Asunto: Re: How to restrict external connections
>
> Néstor Boscán wrote:
> > Hi
> >
> > Is there a way to restrict external connection to a Derby  
> Database?. I
> > only want the JVM to be able to connect to the Derby database and no
> > other external processes.
>
> Hello,
>
> Unless I have misunderstood, sounds like you simply want to use Derby
> embedded. This is done by using  
> org.apache.derby.jdbc.EmbeddedDriver and
> specifying the connection URL as 'jdbc:derby:myDatabase 
> [;create=true;...]'.
> By default, no network server will be started and only the JVM is  
> able to
> access the database.
>
> Note that 'myDatabase' can point to a database by using either a  
> relative
> path (relative to derby.system.home , or current working directory  
> if it is
> unset) or an absolute path.
>
> Did that answer you question, or do you have any further requirements?
>
>
> regards,
> --
> Kristian
>
>
> >
> > Regards,
> >
> > Néstor Boscán
>
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


RE: How to restrict external connections

Posted by Néstor Boscán <ne...@gmail.com>.
Thanks Manta for the info

  _____  

De: Mamta Satoor [mailto:msatoor@gmail.com] 
Enviado el: Tuesday, September 11, 2007 2:12 AM
Para: Derby Discussion
Asunto: Re: How to restrict external connections


It is the database that will only be up in one JVM at a time. You could have
multiple JVMs running Derby but accessing different databases. In other
words, Derby can be up in multiple JVMs but those different JVMs can't
access the same database. Of course, this discussion applies to embedded
mode. 
 
Mamta

 
On 9/10/07, Néstor Boscán <ne...@tcs.com.ve> wrote: 

Hi Mamta thanks for the answer.
 
So basically Derby will only be up in one JVM at a time. Correct?
 
Regards,
 
Néstor Boscán

  _____  

De: Mamta Satoor [mailto:msatoor@gmail.com] 
Enviado el: Tuesday, September 11, 2007 1:13 AM 

Para: Derby Discussion
Asunto: Re: How to restrict external connections


 

Néstor,
 
If a tool like ij is started in a new JVM, then it will not be able to
connect to an embedded database which has been started by a different JVM. 
 
HTH,
Mamta
 
On 9/10/07, Néstor Boscán <nestor.boscan@tcs.com.ve
<ma...@tcs.com.ve> > wrote: 

Hi Kristian

Thanks for the answer.

So this means that if I open the database using the EmbeddedDriver driver no

one can access the database from an outside connection?. Includiing tools
like ij?

Regards,

Néstor Boscán

-----Mensaje original-----
De: Kristian.Waagan@Sun.COM  <ma...@Sun.COM>
[mailto:Kristian.Waagan@Sun.COM]
Enviado el: Monday, September 10, 2007 4:27 AM 
Para: Derby Discussion
Asunto: Re: How to restrict external connections

Néstor Boscán wrote: 
> Hi
>
> Is there a way to restrict external connection to a Derby Database?. I
> only want the JVM to be able to connect to the Derby database and no 
> other external processes.

Hello, 

Unless I have misunderstood, sounds like you simply want to use Derby
embedded. This is done by using org.apache.derby.jdbc.EmbeddedDriver and
specifying the connection URL as 'jdbc:derby:myDatabase[;create=true;...]'. 
By default, no network server will be started and only the JVM is able to
access the database.

Note that 'myDatabase' can point to a database by using either a relative
path (relative to derby.system.home , or current working directory if it is
unset) or an absolute path.

Did that answer you question, or do you have any further requirements?


regards,
--
Kristian


>
> Regards,
>
> Néstor Boscán






Re: How to restrict external connections

Posted by Mamta Satoor <ms...@gmail.com>.
It is the database that will only be up in one JVM at a time. You could have
multiple JVMs running Derby but accessing different databases. In other
words, Derby can be up in multiple JVMs but those different JVMs can't
access the same database. Of course, this discussion applies to embedded
mode.

Mamta


On 9/10/07, Néstor Boscán <ne...@tcs.com.ve> wrote:
>
>  Hi Mamta thanks for the answer.
>
> So basically Derby will only be up in one JVM at a time. Correct?
>
> Regards,
>
> Néstor Boscán
>
>  ------------------------------
> *De:* Mamta Satoor [mailto:msatoor@gmail.com]
> *Enviado el:* Tuesday, September 11, 2007 1:13 AM
> *Para:* Derby Discussion
> *Asunto:* Re: How to restrict external connections
>
>
>  Néstor,
>
> If a tool like ij is started in a new JVM, then it will not be able to
> connect to an embedded database which has been started by a different JVM.
>
> HTH,
> Mamta
>
> On 9/10/07, Néstor Boscán <ne...@tcs.com.ve> wrote:
> >
> > Hi Kristian
> >
> > Thanks for the answer.
> >
> > So this means that if I open the database using the EmbeddedDriver
> > driver no
> > one can access the database from an outside connection?. Includiing
> > tools
> > like ij?
> >
> > Regards,
> >
> > Néstor Boscán
> >
> > -----Mensaje original-----
> > De: Kristian.Waagan@Sun.COM [mailto:Kristian.Waagan@Sun.COM]
> > Enviado el: Monday, September 10, 2007 4:27 AM
> > Para: Derby Discussion
> > Asunto: Re: How to restrict external connections
> >
> > Néstor Boscán wrote:
> > > Hi
> > >
> > > Is there a way to restrict external connection to a Derby Database?. I
> > > only want the JVM to be able to connect to the Derby database and no
> > > other external processes.
> >
> > Hello,
> >
> > Unless I have misunderstood, sounds like you simply want to use Derby
> > embedded. This is done by using org.apache.derby.jdbc.EmbeddedDriver and
> > specifying the connection URL as
> > 'jdbc:derby:myDatabase[;create=true;...]'.
> > By default, no network server will be started and only the JVM is able
> > to
> > access the database.
> >
> > Note that 'myDatabase' can point to a database by using either a
> > relative
> > path (relative to derby.system.home , or current working directory if it
> > is
> > unset) or an absolute path.
> >
> > Did that answer you question, or do you have any further requirements?
> >
> >
> > regards,
> > --
> > Kristian
> >
> >
> > >
> > > Regards,
> > >
> > > Néstor Boscán
> >
> >
>

RE: How to restrict external connections

Posted by Néstor Boscán <ne...@tcs.com.ve>.
Hi Mamta thanks for the answer.
 
So basically Derby will only be up in one JVM at a time. Correct?
 
Regards,
 
Néstor Boscán

  _____  

De: Mamta Satoor [mailto:msatoor@gmail.com] 
Enviado el: Tuesday, September 11, 2007 1:13 AM
Para: Derby Discussion
Asunto: Re: How to restrict external connections


Néstor,
 
If a tool like ij is started in a new JVM, then it will not be able to
connect to an embedded database which has been started by a different JVM. 
 
HTH,
Mamta
 
On 9/10/07, Néstor Boscán <ne...@tcs.com.ve> wrote: 

Hi Kristian

Thanks for the answer.

So this means that if I open the database using the EmbeddedDriver driver no

one can access the database from an outside connection?. Includiing tools
like ij?

Regards,

Néstor Boscán

-----Mensaje original-----
De: Kristian.Waagan@Sun.COM  <ma...@Sun.COM>
[mailto:Kristian.Waagan@Sun.COM]
Enviado el: Monday, September 10, 2007 4:27 AM
Para: Derby Discussion
Asunto: Re: How to restrict external connections

Néstor Boscán wrote: 
> Hi
>
> Is there a way to restrict external connection to a Derby Database?. I
> only want the JVM to be able to connect to the Derby database and no
> other external processes.

Hello, 

Unless I have misunderstood, sounds like you simply want to use Derby
embedded. This is done by using org.apache.derby.jdbc.EmbeddedDriver and
specifying the connection URL as 'jdbc:derby:myDatabase[;create=true;...]'. 
By default, no network server will be started and only the JVM is able to
access the database.

Note that 'myDatabase' can point to a database by using either a relative
path (relative to derby.system.home , or current working directory if it is
unset) or an absolute path.

Did that answer you question, or do you have any further requirements?


regards,
--
Kristian


>
> Regards,
>
> Néstor Boscán





Re: How to restrict external connections

Posted by Mamta Satoor <ms...@gmail.com>.
Néstor,

If a tool like ij is started in a new JVM, then it will not be able to
connect to an embedded database which has been started by a different JVM.

HTH,
Mamta

On 9/10/07, Néstor Boscán <ne...@tcs.com.ve> wrote:
>
> Hi Kristian
>
> Thanks for the answer.
>
> So this means that if I open the database using the EmbeddedDriver driver
> no
> one can access the database from an outside connection?. Includiing tools
> like ij?
>
> Regards,
>
> Néstor Boscán
>
> -----Mensaje original-----
> De: Kristian.Waagan@Sun.COM [mailto:Kristian.Waagan@Sun.COM]
> Enviado el: Monday, September 10, 2007 4:27 AM
> Para: Derby Discussion
> Asunto: Re: How to restrict external connections
>
> Néstor Boscán wrote:
> > Hi
> >
> > Is there a way to restrict external connection to a Derby Database?. I
> > only want the JVM to be able to connect to the Derby database and no
> > other external processes.
>
> Hello,
>
> Unless I have misunderstood, sounds like you simply want to use Derby
> embedded. This is done by using org.apache.derby.jdbc.EmbeddedDriver and
> specifying the connection URL as
> 'jdbc:derby:myDatabase[;create=true;...]'.
> By default, no network server will be started and only the JVM is able to
> access the database.
>
> Note that 'myDatabase' can point to a database by using either a relative
> path (relative to derby.system.home, or current working directory if it is
> unset) or an absolute path.
>
> Did that answer you question, or do you have any further requirements?
>
>
> regards,
> --
> Kristian
>
>
> >
> > Regards,
> >
> > Néstor Boscán
>
>

RE: How to restrict external connections

Posted by Néstor Boscán <ne...@tcs.com.ve>.
Hi Kristian

Thanks for the answer.

So this means that if I open the database using the EmbeddedDriver driver no
one can access the database from an outside connection?. Includiing tools
like ij?

Regards,

Néstor Boscán 

-----Mensaje original-----
De: Kristian.Waagan@Sun.COM [mailto:Kristian.Waagan@Sun.COM] 
Enviado el: Monday, September 10, 2007 4:27 AM
Para: Derby Discussion
Asunto: Re: How to restrict external connections

Néstor Boscán wrote:
> Hi
>  
> Is there a way to restrict external connection to a Derby Database?. I 
> only want the JVM to be able to connect to the Derby database and no 
> other external processes.

Hello,

Unless I have misunderstood, sounds like you simply want to use Derby
embedded. This is done by using org.apache.derby.jdbc.EmbeddedDriver and
specifying the connection URL as 'jdbc:derby:myDatabase[;create=true;...]'.
By default, no network server will be started and only the JVM is able to
access the database.

Note that 'myDatabase' can point to a database by using either a relative
path (relative to derby.system.home, or current working directory if it is
unset) or an absolute path.

Did that answer you question, or do you have any further requirements?


regards,
--
Kristian


>  
> Regards,
>  
> Néstor Boscán


Re: How to restrict external connections

Posted by Kristian Waagan <Kr...@Sun.COM>.
Néstor Boscán wrote:
> Hi
>  
> Is there a way to restrict external connection to a Derby Database?. I 
> only want the JVM to be able to connect to the Derby database and no 
> other external processes.

Hello,

Unless I have misunderstood, sounds like you simply want to use Derby 
embedded. This is done by using org.apache.derby.jdbc.EmbeddedDriver and 
specifying the connection URL as 'jdbc:derby:myDatabase[;create=true;...]'.
By default, no network server will be started and only the JVM is able 
to access the database.

Note that 'myDatabase' can point to a database by using either a 
relative path (relative to derby.system.home, or current working 
directory if it is unset) or an absolute path.

Did that answer you question, or do you have any further requirements?


regards,
-- 
Kristian


>  
> Regards,
>  
> Néstor Boscán


Re: How to restrict external connections

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> Is there a way to restrict external connection to a Derby Database?. I 
> only want the JVM to be able to connect to the Derby database and no 
> other external processes.

Use the embedded configuration, then, not the client/server configuration.
In the embedded environment, only the JVM which runs your application
will be allowed to access the database.

http://db.apache.org/derby/docs/10.3/getstart/cgsquck35643.html

thanks,

bryan