I am doing a project using JSP. My Issue is..... I have two departments name Customs and Accounts in the database with different tables. I have designed the HTML page in such a way the I have a drop down list consisting of Customs and Accounts. I have user accounts of both the departments.
Now, my intention is to select the department from the drop down box and then login to the page.
I have a drop down list box with Customs and Accounts..A Username and a Password field.Now want to login to the page by selecting the drop down box. Suppose the Customs username is 1001 and Accounts Username is 1002. and password is abcd.
In my project I have different departments say, Customs in one table and Accounts in other table. The code provided is having the departments in the same table. Bcoz as per the SQL Query select * from login where username='"+user+"' and password='"+pass+"'and department='"+dep+"' the departments is in the same table. And my issue is I want to login using different departments Customs and Accounts which are in different tables and as soon as I login I have to get individual page of Customs and Accounts.
Suppose In Customs, I have a DEPTID DEPTNAME DEPTHEAD PASSWORD ---- THIS IS ONE TABLE THE SAME LIKE ACCOUNTS. Now I want to login when I select department from the drop down list. Since I cannot populate the departments name from each table into drop down I use Select tag and declare as CustomsDept and AccountsDept
Please provide me the code on how to login using the drop down box and the Username and passwords must match with the Database during Login. One of my friend suggest me to use if(option.equals) condition for LOGIN...Please provide me the code for the above senario.....I'll be grateful to you forever.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.