📅  最后修改于: 2022-03-11 14:59:53.360000             🧑  作者: Mango
{
String userName = request.getParameter("uname");
String contact = request.getParameter("contact");
//code for DB Connection
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databasename=sushil;user=sa; password=MultiMetal");
Statement st = con.createStatement();
st.executeUpdate("insert into tblUser (UserName, Contact) values('" + userName + "','" + contact + "')");
request.getRequestDispatcher("Welcome.html").forward(request, response);