我用JSP做一个用户登录模块,用户名和密码是放在数据库里面的,现在想用MD5加密,以防数据库中的密码被盗。请问该加密算法代码怎么写?相关代码如下:<%
     String user_id = request.getParameter("userid"); 
     String pass_word = request.getParameter("password");
  %>
  <%
     Connection con = null;
     Statement stmt = null;
     ResultSet rs;
     boolean flag = false;
   try
     {
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DatabaseName=After_service","sa","beckham");
        String sql = "select userid,password from UserT where userid= '"+ user_id+"' "+"and"+ " password = '" + pass_word+"'";
        stmt = con.createStatement();
        out.print("成功!");
        rs = stmt.executeQuery(sql);
       if(rs.next())
       {
          flag = true;
       }
     } 
     catch(Exception e)
     {
        out.print("e");
     }
     finally
 {
  try{
  con.close();
  }catch(Exception e){}
 }
  %>
   <%
  if(flag)
  {
%>
  <jsp:forward page="welcome.jsp" />
<%  
  }
  else
  {
%>
  <jsp:forward page="fail.jsp" />
<%
}
 %>