后端如何节省代码占用空间

发布时间 2023-05-16 22:24:27作者: 子过杨梅
public Connection connect;
    public Thesql()throws Exception
    {
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/pddabc?useUnicode=true&characterEncoding=utf8";
        String username="root";
        String password="Njx200259";
        connect = DriverManager.getConnection(url,username,password);
    }
    public void finalize() throws Exception
    {
        connect.close();
    }