D
D
Denis Kuznetsov2020-11-29 14:33:56
Java
Denis Kuznetsov, 2020-11-29 14:33:56

What is a PreparedStatement implementation?

The PreparedStatement interface inherits from the Statement interface, but what is their implementation? Even in the oracle docs, as elsewhere it is written that this interface creates an object, but the interface object cannot be created, the implementation object must be created. Please explain this point.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lyoshik, 2020-11-29
@DennisKingsman

The implementation provides a database-specific JDBC driver. PostgreSQL example
This is done in order not to be dependent on a specific database driver. If you change the driver to another (for example, change the database), then when using interfaces, your code will not change at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question