Q:

JDBC interface object in java

If interfaces cannot be instantiated, then how can we create objects of Statement interface in JDBC?
I went to the Oracle Java documentation, it shows:
public interface Statement
extends Wrapper, AutoCloseable

I guess the code below is creating a reference variable, but I need a proper explanation that I can't find anywhere.
Statement stmt = con.createStatement();

If it is an interface, then how can it define method bodies? Obviously it isn't a class.

A:

In your example, con.createStatement() will be returning an instance of some class which implements the Statement interface.
con is presumably a concrete instance of a class which implements java.sql.Connection, and that concrete implementation of Connection defines what type of Statement it should return.
The easiest way to see this would be to run your code with a debugger, and you'll be able to see the actual type that stmt is at runtime. That type will be something that implements Statement.
To give a very simple example of how this might work for an imaginary database called "SomeDatabase", you have the Statement interface that you've shown above:
public interface Statement extends Wrapper, AutoCloseable

and the Connection interface:
public interface Connection extends Wrapper, AutoCloseable

And let's say con is an instance of a concrete class called SomeDatabaseConnection, which implements the method createStatement because that's required by the Connection interface. The implementation of createStatement returns an instance of a concrete class implementing Statement that's specific to "SomeDatabase":
public class SomeDatabaseConnection implements Connection {
    public Statement createStatement() {
        return new SomeDatabaseStatement();
    }
}

Now we can say:
Connection con = new SomeDatabaseConnection();
Statement stmt = con.createStatement();

Hopefully you can see here that the actual concrete class that's returned is an instance of SomeDatabaseStatement, which implements Statement.
The whole point of all this is that the details can be hidden away from your application code; it doesn't matter whether your Connection or Statement are provided by Oracle, MySQL or "SomeDatabase", the functionality that they provide is guaranteed by the interfaces that you develop against, so you can easily switch out one database for another without changing your own code at all.
Terminology
Although the actual concrete class of stmt is some specific class (SomeDatabaseStatement in my silly example), we can still say it "is a Statement", because it complies to all the requirements of the Statement interface.
Additionally, because the Statement interface extends Wrapper and AutoCloseable, we can say that stmt "is a Wrapper" and "is an AutoCloseable", because we know that it must comply with the requirements of both those interfaces too.
Your line:
Statement stmt = con.createStatement();

Could be written as:
MyDatabaseStatement stmt = con.createStatement();

but would also be just as correct written as:
Wrapper stmt = con.createStatement();

or
AutoCloseable stmt = con.createStatement();

The obvious next question is which of those should we choose? The simple answer to that is whichever gives you all the functionality you need, and no more.
In this specific example, for most cases that will be Statement, because the Statement interface gives you all the useful methods for interacting with a database. However, if, for some reason, the only method you needed to call was close(), which is defined in the AutoCloseable interface, then it would probably be better to use AutoCloseable instead of Statement.
To learn more about why this is good, read about the Dependency Inversion Principle.

