The problem here is this:
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/project";
String userid = "root";
String password = "";
pst=conn.prepareStatement(sql);
You missed the important step of actually opening the connection, leaving conn
null when you try and use it. Try adding the following, before you call conn.prepare...
conn = DriverManager.getConnection(url, userid, password);