I want to save data in sql server database without username or password. the code example is given bellow. Can anyone explain the cause of not save the data into database? Thank in advance. Please help me
<%
String username = request.getParameter("username");
String password = request.getParameter("password");
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String url = "jdbc:sqlserver://localhost:1433;databaseName=azan";
Connection con = null;
con = DriverManager.getConnection(url);
Statement st = con.createStatement();
String sql = "INSERT INTO huzaifa (username,password) VALUES ('"+username+"','"+password+"')";
st.executeUpdate(sql);
con.close();
}catch (Exception ex)
{
System.out.print(ex);
}//
%>