This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC double and decimal types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC double and decimal types" Watch "JDBC double and decimal types" New topic
Author

JDBC double and decimal types

Abhishek Boppudi
Greenhorn

Joined: Jun 11, 2013
Posts: 8
Can anyone, please explain me Types.DOUBLE and Types.DECIMAL etc.. in java.sql package.I'm a novice please help me out.
And other question is " Why we are writing interfaces even though they doesn't contain methods ?" Are they only for imposing implementation on classes ?
Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 505
    
    1

You should read doc of Types to know what it is for :
The class that defines the constants that are used to identify generic SQL types, called JDBC types.

In eclipse it is simply needed to move and stop mouse over class name to see its doc.
If it is not available then you need to download the sources.
" Why we are writing interfaces even though they doesn't contain methods ?"

Simply to make several classes have the same type. Then we may check if instance belongs to that type by instanceof operator.
For instance if class implements Serializable it means that it can be used in java serialization methods.
Serializable describes feature of class that is class can be serialized.

Interfaces exist to make client independent on implementation as the same interface can be implemented by many classes.

True person is moral, false is right!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC double and decimal types
 
Similar Threads
How to run my own jsp file?
ClassLoader problem :ClassCastException
Need your suggestion on ErrorHandling
Drop down box not working in IE7 but very well displayed in Mozzila
Teradata ????? does it has scope