db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Cowan" <cow...@freenet.co.uk>
Subject Re: remote connections to embedded derby
Date Thu, 11 Aug 2005 15:52:40 GMT
Hi

thanks. I will try this.

James

----- Original Message ----- 
From: "Matt Sanford" <mzsanford@aol.com>
To: "Derby Discussion" <derby-user@db.apache.org>
Sent: Thursday, August 11, 2005 2:54 PM
Subject: Re: remote connections to embedded derby


> Hello,
>
>     I have some code currently using the embedded driver with optional
> networking. I put both jars (derby and derbynet) in my classpath and
> then have the following code :
>
>             if (allowNetworkConnections == true) {
>                 log.info("Starting network server in addition to
> embedded.");
>
System.setProperty("derby.drda.startNetworkServer","true");
>                 System.setProperty("derby.drda.host","0.0.0.0");
>             }
>
>     When this is enabled I can use ij on the same host to query the
> in-use database, when it is disabled I cannot. I have not tried it with
> truly remote clients nor tested it very thoroughly, but it worked for my
> purposes.
>
> -- Matt
>
> Oyvind.Bakksjo@Sun.COM wrote:
>
> > Knut Anders Hatlen wrote:
> >
> >> James Cowan <cowanj@freenet.co.uk> writes:
> >>
> >>
> >>> Hi
> >>>
> >>> is it possible to make remote connections to an embedded derby
> >>> database?
> >>
> >>
> >>
> >> No, you'll have to run the the network server. However, the network
> >> server is just a layer of networking code on top of an embedded derby
> >> database, so in some sense you can say it makes it possible to make
> >> remote connections to an embedded database. But that wasn't what you
> >> had in mind, I guess...
> >
> >
> > Isn't it?
> >
> > http://db.apache.org/derby/docs/10.1/adminguide/cadminovntsrvsample.html
> >
> > Quote:
> >
> > "The embedded driver is loaded when the Network Server is started. The
> > JVM that starts the Network Server can obtain an embedded connection
> > to the same database that the Network Server is accessing to serve
> > clients from other JVMs. This solution provides the performance
> > benefits of the embedded driver and also allows client connections
> > from other JVMs to connect to the same database."
> >
> > To illustrate this in beautiful ascii-art (best viewed with fixed font
> > width):
> >
> > +--------------------------------------+
> > | Client JVM                           |
> > | +------------------------+           |
> > | | Your application logic |           |
> > | +------------+-----------+           |
> > |              |                       |
> > |              V                       |
> > | +----------------------------------+ |
> > | |    Network Client JDBC driver    | |
> > | +-----------------------------+----+ |
> > |                               |      |
> > +-------------------------------|------+
> >                                 |
> > +-------------------------------|------+
> > | Server JVM                    |      |
> > | +------------------------+    |      |
> > | | Your application logic |    |      |
> > | +------------+-----------+    |      |
> > |              |                V      |
> > |              |    +----------------+ |
> > |              V    | Network Server | |
> > | +-----------------+----------+-----+ |
> > | |    Embedded JDBC driver    |     | |
> > | +----------------------------+     | |
> > | |          Derby engine            | |
> > | +----------------------------------+ |
> > +--------------------------------------+
> >
>
> -- 
> When the going gets tough, the weird turn pro.
>   -- Hunter S. Thompson
>


Mime
View raw message