The Java Database Connectivity (JDBC) API allows Java programmers to access data from any database. You can use the JDBC…