Re: A basic question about constants
- From: "John B. Matthews" <nospam@xxxxxxxxxx>
- Date: Sat, 23 Jul 2005 15:51:08 GMT
In article <42e1fbdb$0$29943$636a15ce@xxxxxxxxxxxx>,
Richard <grin@xxxxxxxx> wrote:
> Hello,
>
> An extract from the javadoc of javax.sql.rowset.CachedRowSet (an interface):
> ---
> COMMIT_ON_ACCEPT_CHANGES
>
> static final boolean COMMIT_ON_ACCEPT_CHANGES
>
> Causes the CachedRowSet object's SyncProvider to commit the changes when
> acceptChanges() is called. If set to false, the changes will not be
> committed until one of the CachedRowSet interface transaction methods is
> called.
>
> See Also:
> commit(), rollback(), Constant Field Values
> ---
>
> My basic question is: how is it possible to change the value of a
> constant defined in an interface?
>
> Thanks in advance for your answers.
>
> Richard
AFAIK, you can't: "Every field declaration in the body of an interface
is implicitly public, static, and final." [§9.3] The value is set by the
implementation so you'll know how to handle commits:
"Note: The acceptChanges() method will determine if the
COMMIT_ON_ACCEPT_CHANGES is set to true or not. If it is set to true,
all updates in the synchronization are committed to the data source.
Otherwise, the application _must_ explicit[l]y call the commit() or
rollback() methods as appropriate." [J2SE 1.5 API]
--
John
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/
.
- Follow-Ups:
- Re: A basic question about constants
- From: Richard
- Re: A basic question about constants
- References:
- A basic question about constants
- From: Richard
- A basic question about constants
- Prev by Date: Re: Installed JDK on Windows XP, no javac?
- Next by Date: Re: A basic question about constants
- Previous by thread: A basic question about constants
- Next by thread: Re: A basic question about constants
- Index(es):
Relevant Pages
|