There are three ways to connect to a database using JDBC: 1) using a URL, 2) using a user ID and password, and 3) using properties. The URL method passes the full JDBC URL, driver class, and credentials to establish the connection. The user ID/password method loads the driver class, gets the connection using the URL, user name, and password, then gets and executes a statement. The properties method loads the driver class, gets the connection using a properties map containing the user name and password, then gets metadata about a table including its columns and types.