db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Buzolin <dbuz5ga...@gmail.com>
Subject Re: Interfacing with embedded derby from an outside process/shell
Date Wed, 02 Aug 2017 18:15:18 GMT
The app can be taken down. I just trying to wrap my head around this scenario, since I am not
great in Derby and doc is bit scant for this case.
Ok, so I see the connection via network drive is an option. Does Derby exposes the any listening
port when it is started in embedded mode?

> On Aug 2, 2017, at 12:45 PM, Kristian Waagan <kristwaa@apache.org> wrote:
> No, that is not supported using the embedded driver only.
> You either have to shut down the application, or connect using the network driver (while
the application itself connects using the embedded driver). The "embedded server mode" is
described at [1] and in the admin guide.
> Do you need the application to be up while you interface with the database manually?
> Regards,
> -- 
> Kristian
> [1] https://stackoverflow.com/q/374833/4473053 <https://stackoverflow.com/q/374833/4473053>
> Den ons. 2. aug. 2017, 16:46 skrev Dmitry Buzolin <dbuz5games@gmail.com <mailto:dbuz5games@gmail.com>>:
> Thanks you Kristian,
> Booting/opening is clear. But say Derby is booted/opened by an application, can I connect
to the same database via IJ tools and interface with the database (UPDATE/INSERT/DELETE)?
Or this is not supported? 
>> On Aug 2, 2017, at 10:39 AM, Kristian Waagan <kristwaa@apache.org <mailto:kristwaa@apache.org>>
>> Hi Dmitry,
>> Only one process can open / boot a specific database (usually a set of files on disk)
at a given time.
>> Depending on your requirements you can:
>>  a) shut down the application and boot the database using any standard JDBC tool
(using the embedded driver)
>>  b) if you need to be able to access the database while the application is running,
you need to enable the Derby network server mode and connect to it using the network driver.
This can be done in more than one way, for instance by specifying a system property on startup.
This may have security implications for your application.
>> If this is a permanent requirement, it should be possible to start and stop the network
server from within your application (i.e. by adding support for this feature in your application).
See the Derby Administration guide for more info.
>> Hope this helps,
>> -- 
>> Kristian
>> ons. 2. aug. 2017 kl. 14:47 skrev Dmitry Buzolin <dbuz5games@gmail.com <mailto:dbuz5games@gmail.com>>:
>> Hi List!
>> I have a tough problem: My application runs Derby in embedded mode and I have a requirement
to change/correct data inside this database.
>> What is a best way to do this if it is possible? For example if I open this database
location via "file://patch <> to db folder” will this work properly wrt data consistency,
locking etc (since the database is accessed from within the app code)?

View raw message