Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet unable to validate username and password from ms acess database
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


surace thapa
unable to validate username and password from ms acess database
1 Answer(s)      a year and 10 months ago
Posted in : JSP-Servlet


//this code is not working! please help me to find error. thanks.

<%@ page import="java.sql.*" %>
<%
Connection con=null;

String user=request.getParameter("userid");
session.putValue("userid",user); 
String pwd=request.getParameter("pwd");
try{
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
     con = DriverManager.getConnection("jdbc:odbc:mydb","",""); 
           Statement st=con.createStatement();
           ResultSet rs=st.executeQuery("select * from table1 where userid='"+user+"' and pwd='"+pwd+"'");
           int i=0;
           while(rs.next()){
           i++;
           }
          if(i>0){
           out.println("welcome " +user);

           }
          else{
           response.sendRedirect("login.html");
          }
        }
    catch(Exception e){
    System.out.println(e);
}
%>

Advertisement
View Answers

November 3, 2012 at 4:31 PM


Follow these steps:

1)Go to the start->Control Panel->Administrative Tools-> data sources.

2)Click Add button and select the driver Microsoft Access Driver(*.mdb).

3)After selecting the driver, click finish button.

4)Then give Data Source Name and click ok button.

5)Your DSN will get created.

6) Restart your server and run your jsp/servlet code



Related Tutorials/Questions & Answers:
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  this code is not working! please help me to find error. thanks. <%@ page... * from table1 where userid='"+user+"' and pwd='"+pwd+"'"); int i=0
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  this code is not working! please help me to find error. thanks. <%@ page... * from table1 where userid='"+user+"' and pwd='"+pwd+"'"); int i=0
Advertisements
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  //this code is not working! please help me to find error. thanks. <%@ page... * from table1 where userid='"+user+"' and pwd='"+pwd+"'"); int i=0
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  //this code is not working! please help me to find error. thanks. <%@ page... * from table1 where userid='"+user+"' and pwd='"+pwd+"'"); int i=0
validating username and password from database
validating username and password from database  Hello sir, i am developing a login page. i want that when i fill data in text fields. it validate data from database. if enter data is match from database. page goes to next page
Load Coursenames from MS Acess Database to JComboBox - Java Beginners
Load Coursenames from MS Acess Database to JComboBox  Hello sir, I want to Load/add Course names which stored in Ms Acess 2007 Database, plz help... name from course"); jc.addItem("Select"); while(rs.next()){ jc.addItem
Acess Record from database.
Acess Record from database.  How to access records from database and how to display it on view page, with the help of hibernate
how to check username & password from database using jsp
how to check username & password from database using jsp  Hello, I have created 1 html page which contain username, password & submit button. in my oracle10G database already contain table name admin which has name, password
Username password
that will validate usernames and passwords from a database. I need help with the validation, so that if the username and password match it will continue...=st.executeQuery("select * from login where username='"+value1+"' and password='"+value2
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
Java Read username, password and port from properties file
Java Read username, password and port from properties file In this section, you will come to know how to read username, password and port no from the properties file and display the data from the database. Now to load the data from
How to Validate JRadioButton and How to Save data from JRadioButton to MS Access Database - Java Beginners
How to Validate JRadioButton and How to Save data from JRadioButton to MS... JRadioButton I want Store Information from JRadioButton to MS Access Database, and I... is successfully inserted into database."); } catch(Exception ex
username and password in servlet
username and password in servlet  i'm usng eclipse luna(java programming) Sevlet and apache tomcat8.0 i need to do a login page then after login... in: Please Enter Your User Name: Please Enter Your Password
to fetch data from ms word and storing into database
to fetch data from ms word and storing into database  i want to know how to fetch datafields from ms word and storing into database??? please answer soon .its urgent
unable to get datas from oracle database
unable to get datas from oracle database  Dear Sir, I am again struck in my project.. i want to display data from oracle database but i get...=con.prepareStatement("select * from departments"); ResultSet rs
encrypt the username and password using PHP
encrypt the username and password using PHP  How can we encrypt the username and password using PHP?   Hi friends, You can use the MySQL PASSWORD() function to encrypt username and password. For example, INSERT
create webpage with table sql database using netbeans 6.8 with struts complete tutorial.(include username and password)
create webpage with table sql database using netbeans 6.8 with struts complete tutorial.(include username and password)   myself muthu,am working as software trainee in reputed concern.our company gave one project to me.create
create webpage with table sql database using netbeans 6.8 with struts complete tutorial.(include username and password) 0 Answer(s)
create webpage with table sql database using netbeans 6.8 with struts complete tutorial.(include username and password) 0 Answer(s)  create webpage... username and password
validating username and password in servlet and redirect to login page with error message if not valid
validating username and password in servlet and redirect to login page with error message if not valid  hi i want to validate my login page username and password in my servlet against database and if not valid want to display
How to search the table name in MS SQL Database 2005 from application
How to search the table name in MS SQL Database 2005 from application  How to search the table name in MS SQL Database 2005 from application from our helpdesk application? application might be in html
to get picture from ms access database by jsp-servlet....
to get picture from ms access database by jsp-servlet....  I have inserted a picture in ms access data base,,,how we can retrieve that picture by using jsp
jsp login code ... when username , drop down box and password is correct
=st.executeQuery("select * from login where username='"+user+"' and password='"+pass...jsp login code ... when username , drop down box and password is correct  i need a jsp code for login.... when username password and dropdown box
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  Hi all my Friends I have below code which insert a picture into M.S. Access Database But i m still not able to open this picture through Java using M.S. Access
unable to connect database in java
unable to connect database in java  Hello Everyone! i was trying to connect database with my application by using java but i am unable to connect... i was using this code.... try { Driver d=(Driver)Class.forName
jsp login code when username , password and dropdown box value is correct...
jsp login code when username , password and dropdown box value is correct... in dropdown box.... so when i login i all the three username,password and dropdown box...)login.jsp: <html> <script> function validate(){ var username
jsp login code when username , password and dropdown box value is correct...
jsp login code when username , password and dropdown box value is correct... in dropdown box.... so when i login i all the three username,password and dropdown box...: <html> <script> function validate(){ var username
unable to insert data into database
unable to insert data into database    hello.i have a problem... the eid based on ename and the other is inserting data into database based... = Database.getConnection(); ps1=con.prepareStatement("select eid from employee
Advertisements
 

 

 

DMCA.com