Why all are interfaces in JDBC

why all are interfaces in JDBC
If anybody knows the answer tell me plz

Because of encapsulation of major database functionality, such as running queries, processing results, and determining configuration information.
JDBC interfaces is like a plug, where u can plug in any database to your application by adding there respective JDBC Driver.
The JDBC Driver is a set of classes that implement the JDBC interfaces to process JDBC calls and return result sets to a Java application. Thats the magic of encapsulation, we just have to program to the interface rather than the implementation. The implementation might change regularly keeping the interface unchanged and hence our application.
The one of the suggestion of design patterns, is , program to an inteface and not to an implementation.

Similar Messages

  • Why resultset is interface

    Hi all,
    In JDBC, statement, Resultset, CallableStatement, PreparedStatement interfaces there.
    My question is, why they are interfaces but not classes.
    If anybody knows, pl. answer to my question.
    Thanx and regrads,
    srinivas

    They are interfaces because they need to be implemented differently (possibly) by each creator of a JDBC driver. The class that does the work for a PreparedStatement in the Sun ODBC-JDBC driver is not the same one that does the work for a PreparedStatement for the Oracle thin client driver.

  • Why to use Interface if methods are not implemented??

    Hello,
    I am having a problem to clearify as, why to use the interfaces which defines only methods and no implementation??
    When a class implements an interface the methods are implemented by the class itself, don't you think that the same functionality can be achieved if the class defined the method itself...
    The why to use interfaces, just that the same method name can be used by many classes or some other reasons..

    did you google on that? There is lots of information I am sure explaining why you code to an interface defined type rather than a class defined type.
    However, fundamentally you are correct, classes define their own type. The idea is that you use an interface because it allows you to have more than one implementation. Plus you can more easily change the structure of your program if you later wish if you did not use the class type directly.
    You get better answers if you ask in the Patterns forum below.

  • Why all the micro4/3 (Panasonic and Olympus) lenses are missing in Lightroom lens corrections?

    Is there a reason why all the micro4/3 lenses (panasonic, Leica and Olympus) are missing as lens corrections in all Lightroom versions?

    They are not missing. 
    Within the last year or two many cameras do their own lens corrections before writing the JPG or even displaying the image on the back of the camera or in the electronic view finder, so Adobe does the same thing:  the lens profiles are built into the camera raw engine and always applied.  It’s confusing because cameras didn’t used to do this and Adobe didn’t used to do this, so we have the situation of older cameras having lens profiles you had to select from the dropdown lists, while newer cameras don’t require this.  Of course removable-lens cameras still have this situation, but many/most recent P&S cameras have built-in lens corrections.
    The Camera Raw plug-in for Photoshop actually indicates when a built-in profile is being used, but LR does not, yet.

  • HT4539 I don't know why all these charges are accruing on my iPad i have like 250.00 charged and I have no reason for this to occur! Can you tell me what was purchased or what caused these charges!

    I don't know why all these charges are occurring! Can you please tell me what is costing me so much money?

    iTunes Store & Mac App Store: Seeing your purchase history and ...

  • Why all classes in javax.servlet.jsp are abstract?

    Hi all,
    I have two questions about how the package was designed:
    1.) why all the classes in the javax.servlet.jsp are abstract? what is the benefits?
    2.) why almost all the methods in the class, such as jspWriter, are abstract too? And we can use these abstract methods in the way we use "concrete" methods?
    3.) the same thing for HTTPServlet class at javax.servlet package.
    Thanks in advance
    yllx

    Thanks for the message. In fact, you don't need to reply to the message if you don't have the answer.
    I suspect that this has something to do with the abstract factor design pattern. It allows each container engine to implement the detail based on its own specification. I just need some body to put more details on that.
    Since this happens quite often if the J2EE library, it's good for us to understand why they do this way, and how we can use it in our design.
    yylx

  • What are the classes and interface in JDBC

    Please anybody tell me
    What are the Classes in JDBC?
    and
    What are the Interfaces in JDBC?
    Will you please show the classes in one table and interfaces in one table. Plesae
    regards
    pooja.

    Hi jeyan,
    Very more thanks. I am searching lot of time in net to exactly get the classes and interface in jdbc. Now you have given helpful link.
    thank you.
    regards
    pooja

  • Why all the methods in interface should be implemented

    why all the methods in interface should be implemented

    Because you'll break the contract saying "this instance features all methods defined in that interface" otherwise.
    In other words, as long as an interface isn't completely implemented by an instance, it's not validly implemented at all.

  • Why all of the sudden are my icon enlarged on my iphone 4 , i have rebooted three times!

    Why all of the sudden are my icon enlarged on my iphone 4 , i have rebooted three times!

    You might have Zoom on.  To turn it off go to Settings>General>Accessibility>Zoom, set to Off.  Double-tap with three fingers to zoom out and drag with three fingers to move the screen with zoom on.

  • HT4847 Why all My pictures disappear from My pictures, were My pictures goes if they are in iCloud how can i access to it?

    Why all My pictures disappear from My pictures, were My pictures goes if they are in iCloud how can i access to it?

    Your camera roll photos are only stored as part of your iCloud backup, if you are backing up to iCloud.  Only photo stream photos are accessible in your iCloud account, and only by turning on photo stream.  If you turn on photo stream, any photos in your photo stream will be found in the photo stream album in the Photos app on your phone.

  • HT204022 I have 1200 pics on camera roll and 900 on photo stream. 1. why are they different? 2. if all are supposedly backed up on iCloud if I delete all photos on my phone will they still be on iCloud or do I need to separately download them to my pc fir

    I have 1200 pics on camera roll and 900 on photo stream. 1. why are they different? 2. if all are supposedly backed up on iCloud if I delete all photos on my phone will they still be on iCloud or do I need to separately download them to my pc first?

    Photos are only uploaded to iCloud after photo stream is enabled.  It's possible that you already had 300 photos in your camera roll when you turn it on so they weren't uploaded.  Also, photo stream also only maintains photos for 30 days, although earlier photos already streamed to your device from photo stream are not deleted.  If you had turned photo stream off, then back on, and the 300 photos fell outside of this 30-day window at the time, they would not be in your photo stream album.  (FYI, photo stream will also only save the last 1000 photos.)
    If you delete the photos on your phone from the camera roll album, photo stream will be not be effected.  If you delete them from the photo stream album on your phone, they will be deleted from your photo stream on your phone and any other devices connected to the same iCloud account/photo stream.
    To keep your camera roll photos permanently, don't rely on photo stream as a backup.  Import them to your computer (http://support.apple.com/kb/HT4083).

  • Why, all of a sudden, are the emails I send, showing they are coming from my husbands email.

    Why, all of a sudden, are the emails I send from my ipad, showing my husbands email on them as the sender?

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • Interfaces in JDBC

    Hi Everyone
    i have a doubt regarding interfaces in JDBC api.my question is why SUN has made Connection,Statement,Resultset etc as interfaces in jdbc.why have they not made them as simple classes.Is there any specific reason behind this thing unless it is sun specific.plesae provide me your comments on the same.
    regards
    kvikram

    This leaves more freedom to the implementors of the very drivers. They can inherit their implementing classes from some internal classes if they wish, which would not be the case if it were an abstract class and not an interface.
    Abstract classes ususally contain some non-complete implementation, interfaces are "just" interfaces. The JDBC very much fits to interfaces.
    So there is no reason for them to be abstract classes and there are reasons for them to be interfaces.

  • Why not use interfaces for constants?

    Hi,
    I have been getting conflicting views about why not use interfaces for constants?
    Can anyone shed some light on it?
    Piyush

    How so?
    If the constants are only used in a single classhow
    does it help to put them in a separate structute?
    (Ignoring the a type safe enumeration of course.)Well, mainly for readability. Suppose that you have a
    web application which has a servlet class
    "RedirectServlet", which takes a variable to redirect
    to a given JSP file. In the JSP files, you want to
    create forms which take this servlet as their action.
    You could of course put all these "redirect"
    constants in the RedirectServlet itself, but then
    it's kind of weird that you have to import a
    servlet in your jsp file to include these constants
    and to be able to write
    <form action="servlet/RedirectServlet?key=<%=
    RedirectServlet.HOMEPAGE %>> or so.
    Instead, you could create an interface called
    "RedirectConstants", and then your servlet
    RedirectServlet could implement this interface. Then
    your JSP can also access these constants via this
    interface.
    But then again, this is merely a matter of style, I
    fully agree that there is never a real _need_ to put
    constants in a separate structure if they're only used
    in a single class.Are you claiming that your example above is a single class?

  • Why there are no layout in number 3.0 ????????

    why there are no layout in number 3.0 ????????
    I need to export the number file to PDF file , I don't want all of the pages are together , I need to seperate the pages in PDF file , I need the PDF file with layout function , just like previous version .
    why are this useful function missing in new version ????????????????????????????????????????????????????????????

    All we know here is that the new version of Numbers is significantly different than the old version of Numbers. We didn't write the specifucation nor do we know what the objectives were for the redesign, other than Apple's stated desire to make the three platform versions of Numbers as compatible as possible across platforms. That's the best "why" we can give you.
    Thanks for using only one exclamation point in your last post.
    Jerry

Maybe you are looking for

  • I can't restore and update my i phone because of error (1). please help

    i can't restore and update my i phone because of error (1). please help

  • InterMedia Java Classes for Servlets and JSPs and Netscape

    I am using the interMedia Java Classes for Servlets and JSPs to upload and retrieve multimedia data. I have found that it is much more performant in Internet Explorer (5.5) than in Netscape Communicator (4.7). In fact, I cannot upload images larger t

  • How to unsync apple tv

    I have all my videos on an external hd, and i used to stream everything (movies would be in shared movies, not my movies), but I synced my atv and it's been a nightmare, movies don't always appear on the list, they stop to buffer, or just stop comple

  • How i get photos in iphone4s from windows7 pc?

    now i am using iphon4s. it is an enjoyable experience to me. it is my first iphone use, that is why i dont understand how i get photos from my windows7 pc.? plz help me...i have haul of imotional pictures in my pc which i want to attach with me 24/7

  • External function specification

    Hi All! (Envs: Centos 5.2, Oracle 10.2.0.4) According to documentation a developer should provide RETURN clause in the external function parameters declaration. But I faced a conflict with additional extproc specific parameters , INDICATOR for exampl