Before APIs like JDBC and ODBC, database connectivity was database vendor-specific and required rewriting code for different databases. JDBC and ODBC standardized database connectivity, allowing applications to access different databases without vendor lock-in. JDBC provides a standard Java API for connecting to relational databases and executing SQL statements. It supports both two-tier and three-tier architectures for database access. There are four main classes of JDBC drivers: Class I uses ODBC bridges, Class II are native API drivers, Class III uses middleware servers, and Class IV are pure Java network protocol drivers.