java.sql.SQLException: No suitable driver found for jdbc:mysqll://localhost:3306/loginuser

0
package db2;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class Main {

	public static void main(String[] args) throws Exception {
		getConnection();

	}

	public static Connection getConnection() throws Exception {
		try {
			String driver = "com.mysql.jdbc.Driver";
			String url = "jdbc:mysqll://localhost:3306/loginuser";
			String username = "root";
			String password = "";
			Class.forName(driver);

			Connection connection = DriverManager.getConnection(url, username, password);
			System.out.println("Connected");
		} catch (Exception e) {
			System.out.println(e);
		}
		return null;
	}
}

Nie mogę połączyć się z bazą danych którą zrobiłem w Workbench'u, wyskakuje mi błąd "java.sql.SQLException: No suitable driver found for jdbc//localhost:3306/loginuser " mimo, że dodałem bibliotekę mysql-conector-java-5.1.45.bin.jar. Proszę o pomoc.

1

Literówka. Masz w urlu mysqll zamiast mysql

1 użytkowników online, w tym zalogowanych: 0, gości: 1