某段截取2

// 数据库连接信息
    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;
        }
posted @ 2023-05-23 22:03  没有名字的没有的人  阅读(12)  评论(0)    收藏  举报