Prev: Signature collision between methods in superclass and interface:suggestions?
Next: parsing dates in a string
From: Arne Vajhøj on 28 Jun 2010 18:04 On 28-06-2010 07:52, gk wrote: > On Jun 28, 4:26 pm, gk<src...(a)gmail.com> wrote: >> On Jun 28, 3:55 pm, RedGrittyBrick<RedGrittyBr...(a)spamweary.invalid> >> wrote: >>> On 28/06/2010 10:41, gk wrote: >>>> please look at the doc for ResultSet >>>> http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#TYPE_... >> >>>> TYPE_SCROLL_SENSITIVE >>>> public static final int TYPE_SCROLL_SENSITIVEThe constant indicating >>>> the type for a ResultSet object that is scrollable and generally >>>> sensitive to changes made by others. >> >>>> What it means by "generally sensitive to changes made by others" ? I >>>> don't get this part. >> >>> For general questions of this sort, you'll often get an adequate answer >>> by searching using Google or some other search engine: >> >>> http://en.wikipedia.org/wiki/Cursor_%28databases%29 >> >>> "Scrollable cursors can potentially access the same row in the result >>> set multiple times. Thus, data modifications (insert, update, delete >>> operations) from other transactions could have an impact on the result >>> set. A cursor can be SENSITIVE or INSENSITIVE to such data >>> modifications. A sensitive cursor picks up data modifications impacting >>> the result set of the cursor, and an insensitive cursor does not." >> >>> Note that this is really an SQL question, more than a Java question. >>> Sometimes you'll get more relevant answers to DBMS-specific SQL >>> questions in an appropriate database newsgroup or forum. >> Thanks . your post was very much helpful.- Hide quoted text - > However , how does it different from attribute CONCUR_UPDATABLE ? > > > If we use CONCUR_UPDATABLE as a ResultSet attribute that too also > picks up the updated data ...is not it ? why do we need the > SENSITIVE attribute then ? I am far from a JBDB expert but I read the docs as: TYPE_SCROLL_INSENSITIVE - I can scroll forward and backward & I will not see changes done by others TYPE_SCROLL_SENSITIVE - I can scroll forward and backward & I will see changes done by others CONCUR_READ_ONLY - I can not update the result set CONCUR_UPDATABLE - I can update the result set So the difference is between me and other. Arne
From: gk on 28 Jun 2010 23:32 On 29 June, 03:04, Arne Vajhøj <a...(a)vajhoej.dk> wrote: > On 28-06-2010 07:52, gk wrote: > > > > > > > On Jun 28, 4:26 pm, gk<src...(a)gmail.com> wrote: > >> On Jun 28, 3:55 pm, RedGrittyBrick<RedGrittyBr...(a)spamweary.invalid> > >> wrote: > >>> On 28/06/2010 10:41, gk wrote: > >>>> please look at the doc for ResultSet > >>>>http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#TYPE_.... > > >>>> TYPE_SCROLL_SENSITIVE > >>>> public static final int TYPE_SCROLL_SENSITIVEThe constant indicating > >>>> the type for a ResultSet object that is scrollable and generally > >>>> sensitive to changes made by others. > > >>>> What it means by "generally sensitive to changes made by others" ? I > >>>> don't get this part. > > >>> For general questions of this sort, you'll often get an adequate answer > >>> by searching using Google or some other search engine: > > >>>http://en.wikipedia.org/wiki/Cursor_%28databases%29 > > >>> "Scrollable cursors can potentially access the same row in the result > >>> set multiple times. Thus, data modifications (insert, update, delete > >>> operations) from other transactions could have an impact on the result > >>> set. A cursor can be SENSITIVE or INSENSITIVE to such data > >>> modifications. A sensitive cursor picks up data modifications impacting > >>> the result set of the cursor, and an insensitive cursor does not." > > >>> Note that this is really an SQL question, more than a Java question. > >>> Sometimes you'll get more relevant answers to DBMS-specific SQL > >>> questions in an appropriate database newsgroup or forum. > >> Thanks . your post was very much helpful.- Hide quoted text - > > However , how does it different from attribute CONCUR_UPDATABLE ? > > > If we use CONCUR_UPDATABLE as a ResultSet attribute that too also > > picks up the updated data ...is not it ? why do we need the > > SENSITIVE attribute then ? > > I am far from a JBDB expert but I read the docs as: > > TYPE_SCROLL_INSENSITIVE - I can scroll forward and backward & I will not > see changes done by others > TYPE_SCROLL_SENSITIVE - I can scroll forward and backward & I will see > changes done by others > CONCUR_READ_ONLY - I can not update the result set > CONCUR_UPDATABLE - I can update the result set > > So the difference is between me and other. > What do you mean by update the ResultSet ? we take the results out of the ResultSet. we do rs.getString("columnName") to extract the result. We don't update ResultSet really. I don't understand why you are saying updating ResultSet. do we do that ever ?
From: Jean-Baptiste Nizet on 29 Jun 2010 04:47 On 29 juin, 05:32, gk <src...(a)gmail.com> wrote: > On 29 June, 03:04, Arne Vajhøj <a...(a)vajhoej.dk> wrote: > > > > > On 28-06-2010 07:52, gk wrote: > > > > On Jun 28, 4:26 pm, gk<src...(a)gmail.com> wrote: > > >> On Jun 28, 3:55 pm, RedGrittyBrick<RedGrittyBr...(a)spamweary.invalid> > > >> wrote: > > >>> On 28/06/2010 10:41, gk wrote: > > >>>> please look at the doc for ResultSet > > >>>>http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#TYPE_... > > > >>>> TYPE_SCROLL_SENSITIVE > > >>>> public static final int TYPE_SCROLL_SENSITIVEThe constant indicating > > >>>> the type for a ResultSet object that is scrollable and generally > > >>>> sensitive to changes made by others. > > > >>>> What it means by "generally sensitive to changes made by others" ? I > > >>>> don't get this part. > > > >>> For general questions of this sort, you'll often get an adequate answer > > >>> by searching using Google or some other search engine: > > > >>>http://en.wikipedia.org/wiki/Cursor_%28databases%29 > > > >>> "Scrollable cursors can potentially access the same row in the result > > >>> set multiple times. Thus, data modifications (insert, update, delete > > >>> operations) from other transactions could have an impact on the result > > >>> set. A cursor can be SENSITIVE or INSENSITIVE to such data > > >>> modifications. A sensitive cursor picks up data modifications impacting > > >>> the result set of the cursor, and an insensitive cursor does not." > > > >>> Note that this is really an SQL question, more than a Java question.. > > >>> Sometimes you'll get more relevant answers to DBMS-specific SQL > > >>> questions in an appropriate database newsgroup or forum. > > >> Thanks . your post was very much helpful.- Hide quoted text - > > > However , how does it different from attribute CONCUR_UPDATABLE ? > > > > If we use CONCUR_UPDATABLE as a ResultSet attribute that too also > > > picks up the updated data ...is not it ? why do we need the > > > SENSITIVE attribute then ? > > > I am far from a JBDB expert but I read the docs as: > > > TYPE_SCROLL_INSENSITIVE - I can scroll forward and backward & I will not > > see changes done by others > > TYPE_SCROLL_SENSITIVE - I can scroll forward and backward & I will see > > changes done by others > > CONCUR_READ_ONLY - I can not update the result set > > CONCUR_UPDATABLE - I can update the result set > > > So the difference is between me and other. > > What do you mean by update the ResultSet ? we take the results out of > the ResultSet. we do rs.getString("columnName") to extract the > result. We don't update ResultSet really. > > I don't understand why you are saying updating ResultSet. > > do we do that ever ? Why don't you read the javadoc? http://java.sun.com/javase/6/docs/api/java/sql/ResultSet.html "A set of updater methods were added to this interface in the JDBC 2.0 API (JavaTM 2 SDK, Standard Edition, version 1.2). The comments regarding parameters to the getter methods also apply to parameters to the updater methods. The updater methods may be used in two ways: [...]"
From: gk on 29 Jun 2010 08:25 > > What do you mean by update the ResultSet ? we take the results out of > > the ResultSet. we do rs.getString("columnName") to extract the > > result. We don't update ResultSet really. > > > I don't understand why you are saying updating ResultSet. > > > do we do that ever ? > > Why don't you read the javadoc?http://java.sun.com/javase/6/docs/api/java/sql/ResultSet.html > > "A set of updater methods were added to this interface in the JDBC 2.0 > API (JavaTM 2 SDK, Standard Edition, version 1.2). The comments > regarding parameters to the getter methods also apply to parameters to > the updater methods. > > The updater methods may be used in two ways: [...]"- Hide quoted text - Thanks . I have gone through that section . I have found the answer. This helped me a lot.
From: Lew on 29 Jun 2010 19:40 gk wrote: >>> What do you mean by update the ResultSet ? we take the results out of >>> the ResultSet. we do rs.getString("columnName") to extract the >>> result. We don't update ResultSet really. Unless you want to make updates to the values in the ResultSet, especially ones that flow through back to the tables. >>> I don't understand why you are saying updating ResultSet. >>> >>> do we do that ever ? Sure we do. Jean-Baptiste Nizet wrote: >> Why don't you read the javadoc? >> <http://java.sun.com/javase/6/docs/api/java/sql/ResultSet.html > >> >> "A set of updater methods were added to this interface in the JDBC 2.0 >> API (JavaTM 2 SDK, Standard Edition, version 1.2). The comments >> regarding parameters to the getter methods also apply to parameters to >> the updater methods. >> >> The updater methods may be used in two ways: [...]" > Thanks . I have gone through that section . I have found the answer. > This helped me a lot. It is a very good habit to read the Javadocs. Personally I find reading Javadocs even for classes/methods with which I'm familiar often reveals new and useful information. P.S., attribute your quotes. -- Lew
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Signature collision between methods in superclass and interface:suggestions? Next: parsing dates in a string |