为什么会有Syntax error, insert "}" to complete ClassBody错误?

import java.sql.;
import java.text.
;

public class DataBase {
Connection conn = null;
PreparedStatement presql;
ResultSet res;
try {
Class.forName("com.mysql.cj.jdbc.Driver");
} catch (Exception e) {
}
String url = "jdbc:mysql://localhost:3306/students?uesSSL=true&characterEncoding=utf-8";

}

你应该把这些代码写到方法里面,不是直接写在类里面。

你是不是sql文没有写对。