Raj;

To all reading this response, this is my first response on this list so if I 
get it a little wrong have patience.

You may want to look at the light weight RDBMS mysql.  It is free, easily 
installed and can be utilized with the companion Workbench to make dealing with 
the db very easy, a lot like the access interface.  You will have good driver 
support from the java end as well and a lot of documentation and tutorials to 
get you connected in your web app to your persistence layer.

mysql.com

Just my two cents and an attempt to give back a little to the community.

Troy

 

 


 

 

-----Original Message-----
From: RAHUL RAJ <omrahulraj...@gmail.com>
To: users <users@tomcat.apache.org>
Sent: Fri, Apr 15, 2011 6:05 am
Subject: Working of Tomcat with MS Access


Hello,

     I am working on  building a jsp website with MS Access as

database. When my login page is loaded on tomcat

(localhost:8080/login.jsp), it shows the following error:



java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source

name not found and no default driver specified.



The jdbc program alone is working perfectly, So There might not be

problems due to  Driver, Data source name, Database Tables or any

other software version compatibilities.



OS: Windows Vista Home Basic

Tomcat Version: 5.5.x

jdk version: 1.6

MS Access 2010





code is given below:



<%@ page language="java" import="java.sql.*" %>

 <html>

 <body>

 <form method="post">

 <p> Enter your username :  <input type="text" name="username"/> </p>

 <p> Enter your password :  <input type="text" name="password"/> </p>

 <input type="submit" value="Login"/>

 <%

    String usn = request.getParameter("username");

        String pass = request.getParameter("password");



        try{

                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

                 String url = "jdbc:odbc:rahul";

                 Connection con = DriverManager.getConnection(url, "", "");

                 Statement s = con.createStatement();

                

                 ResultSet rs = s.executeQuery("select * from customers");

                 while(rs.next())

                 {

                   String u = rs.getString(1);

                   String p = rs.getString(2);

                   if(usn.equals(u) && pass.equals(p))

                   {

                      out.println("login successfull");

                          }

                   else

           {

              out.println("login failed");

             }

           }

        }

                

                catch(Exception e)

                {

                   out.println("Error"+e);

                   }

                        

 %>

 </form>

 </body>

 </html>



---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

For additional commands, e-mail: users-h...@tomcat.apache.org




 

Reply via email to