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.

Thanks,

Alain Kuchta

From: Alain Kuchta [mailto:[email protected]]
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.

Thanks,

Alain Kuchta

Reply via email to