方法是否要加关键字synchronized.因为我担心JDBC中的Connection、ResultSet等是非线程安全的。不知道,我的担心是否多余。代码大概是这样的。
public class Test {
  public static synchronized insertStudent(Student std) {
    Connection conn = ds.getConnection();
    Statement st = conn.createStatemete();
    st.executeUpdate("...");
    ....
  }
}