3
Contributors
2
Replies
11
Views
4 Years
Discussion Span
Last Post by jalpesh_007
0

dear kumar0559,
show some of your code which you have tried, then you will get lot of reply

0

you can do something using following code:

String connectionURL = "jdbc:mysql://192.168.10.59/messagepaging";
  Connection connection=null;
  ResultSet rs;
  String userName=new String("");
  String passwrd=new String("");
  response.setContentType("text/html");
  try {
 // Load the database driver
  Class.forName("com.mysql.jdbc.Driver");
  // Get a Connection to the database
  connection = DriverManager.getConnection(connectionURL, "root", "root"); 
  //Add the data into the database
  String sql = "select user,password from User";
  Statement s = connection.createStatement();
  s.executeQuery (sql);
  rs = s.getResultSet();
  while (rs.next ()){
  userName=rs.getString("user");
  passwrd=rs.getString("password");
  }
  rs.close ();
  s.close ();
  }catch(Exception e){
  System.out.println("Exception is ;"+e);
  }
  if(userName.equals(request.getParameter("user")) 
  && passwrd.equals(request.getParameter("pass"))){
  out.println("User is Valid");
  }
  else{
  out.println("You are not a Valid User");
  }
  }
}  
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.