Interface vs Class
807599Jan 8 2007 — edited Jan 8 2007I have read about the difference between Java Interfaces and Classes and understand it to a reasonable degree.
What is confusing me is the following. How come java.sql.Connection is an Interface? I ask this because I can create a Connection object then call any of the methods from the interface.
example:
cstmt = connection.prepareCall("{CALL Master.."+strStoredProcedure+"(?,?,?,?,?,?,?,?,?)}");
prepareCall is a method in the Connection interface. By definition an interface only declares methods but does not implement them. The above example leads me to believe that the java.sql.Connection interface has implemented the prepareCall method because the class that contains the example statement does not implement the Conenction interfact but just uses the methods in calls.
Thanks for any help in clarifying my understanding.