Question about API listed "Field Summary" items

I

icmrn

When you look in the API at a class or interface, before the methods
comes a section called "Field Summary". I dont understand what these
are for.

In the interface ResultSet, there is one called TYPE_FORWARD_ONLY.
Does this mean that any ResultSet object has a field called
TYPE_FORWARD_ONLY ? Can I set it ? The field is static and returns an
int. An int ? wouldnt it seem more reasonable boolean ?

If you can give me a hint about this, I'd be grateful, but even better
would be if you can point me to something that explains what these
"Field Summary" items are about and how to use them.
 
R

Roedy Green

When you look in the API at a class or interface, before the methods
comes a section called "Field Summary". I dont understand what these
are for.

these are just he members of the class -- variables and constants.
 
R

Roedy Green

In the interface ResultSet, there is one called TYPE_FORWARD_ONLY.
Does this mean that any ResultSet object has a field called
TYPE_FORWARD_ONLY ? Can I set it ? The field is static and returns an
int. An int ? wouldnt it seem more reasonable boolean ?

Don't be afraid to peek at Sun's code with an IDE. It lives in src.zip

/**
* The constant indicating the type for a <code>ResultSet</code>
object
* whose cursor may move only forward.
* @since 1.2
*/
int TYPE_FORWARD_ONLY = 1003;

....
* @return <code>ResultSet.TYPE_FORWARD_ONLY</code>,
* <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>,
* or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
* @exception SQLException if a database access error occurs
* @since 1.2
*/
int getType() throws SQLException;



These are CONSTANTS representing an enum in the days before enums.

You will typically see these constants being used as parameters or
returned from methods, or rarely that you can use to set some variable
directly or make sense of some other variable''s coding int value..
 
R

Roedy Green

/**
* The constant indicating the type for a <code>ResultSet</code>
object
* whose cursor may move only forward.
* @since 1.2
*/
int TYPE_FORWARD_ONLY = 1003;

this is inside an interface so you have an implied static final.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top