某段截取2

发布时间 2023-05-23 22:08:05作者: 没有名字的没有的人
// 数据库连接信息
    private static String url = "jdbc:mysql://localhost/talent_management_system";
    private static String username = "root";
    private static String password = "password";
    private static Connection conn = null;
 
    public static void main(String[] args) {
        // 连接到数据库
        try {
            conn = DriverManager.getConnection(url, username, password);
            System.out.println("成功连接到数据库");
        } catch (SQLException e) {
            System.out.println("无法连接到数据库:" + e.getMessage());
            return;
        }