File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC double and decimal types" Watch "JDBC double and decimal types" New topic

JDBC double and decimal types

Abhishek Boppudi

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 Lysenko
Ranch Hand

Joined: Mar 29, 2012
Posts: 511

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:
subject: JDBC double and decimal types
It's not a secret anymore!