Java Database Connectivity (JDBC) is an application programming interface (API) for the programming language Java, which defines how a…