Results 1 to 2 of 2

Thread: How we are able to access the createStatement(); method

  1. #1
    Geek_Guest
    Guest

    How we are able to access the createStatement(); method

    Connection con = DriverManager.getConnection(..................);

    *Statement st = con.createStatement();

    *Connection,Statement are interfaces and all the methods are abstract methods. Then how we are able to access the createStatement(); method (which is an abstract method) , since we did not provide any implementation in subclass nor implemented Connection interface. How can we use the methods.

    Question asked by visitor Sudheer Martha


  2. #2
    Junior Member
    Join Date
    Feb 2006
    Answers
    1

    Re: How we are able to access the createStatement(); method

    DriverManager.getConnection() returns a concrete implementation of the Connection Interface.

    Similarly, calling createStatement() on the connection object (the concrete connection implementation) returns you a concrete implementation of the Statement.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact