db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain Kuchta <alain.kuc...@etegent.com>
Subject RE: Get a "read-only" connection using Derby EmbeddedDataSource40
Date Fri, 31 Aug 2012 14:05:20 GMT
Hello all,

I've actually found an answer to my own question in the Derby Reference Manual.

The java.sql.Connection method "setReadOnly(boolean)" is supported and performs as I desired.

Perhaps someone else will found this snippet useful.


Alain Kuchta

From: Alain Kuchta [mailto:alain.kuchta@etegent.com]
Sent: Friday, August 31, 2012 9:59 AM
To: Derby Discussion
Subject: Get a "read-only" connection using Derby EmbeddedDataSource40

Hello all,

Does anyone know of a way to establish a "read-only" connection/datasource when using embedded
derby access?

To give some context, I am making a tool to do some transfer from a "source" database to a
"target" database. There should be no alterations made to the source whatsoever. Obviously,
prudent code-writing could ensure this, however, if possible, I would like to further safeguard
against accidental data alterations by making the connection to the "source" database read-only,
so that I would receive and exception or some other kind of error if I accidentally tried
to alter it. I know that result sets can be read only. But that does not fulfill my need entirely.


Alain Kuchta

View raw message