Why executeQuery()
method isn't available in Connection
Class?
If it was available we can easily call executeQuery
method using Connection
Object.
So can't we extend the Statement
Class to Connection
Class to achieve this?
Why executeQuery()
method isn't available in Connection
Class?
If it was available we can easily call executeQuery
method using Connection
Object.
So can't we extend the Statement
Class to Connection
Class to achieve this?
Copyright © 2021 Jogjafile Inc.
It break the Single responsibility principle
Connection class handle connection and doesn't decide/know how to execute the query (single, batch, template...)