package day;
import java.sql.DriverManager;
import com.mysql.jdbc.Connection;
public class Jdbc {
public static void main(String[] args) throws Exception {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3307/test";
String username = "root";
String password = "123";
Connection con = (Connection) DriverManager.getConnection(url, username, password);
System.out.println(con);
}
}
|
|