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

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();
    }

 

posted @ 2023-05-16 22:08  子过杨梅  阅读(10)  评论(0编辑  收藏  举报