bug in login authentication

hi all

i tried one of the code already posted in this forum for login authentication..am using JSP with MS Access

to authenticate the users the code that i executed is:

<html><body>

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

<% try

{

String strUsername = request.getParameter("user");

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

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

Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={logg (login.mdb)};DBQ=C:/Program Files/Apache Tomcat 4.0/webapps/examples/jsp/sampless/login.mdb");

String strSQL = "SELECT username, password FROM log where username=? and password=?";

PreparedStatement statement = myConn.prepareStatement(strSQL);

statement.setString(1, strUsername);

statement.setString(2, strPassword);

ResultSet myResult = statement.executeQuery(strSQL);

if(myResult.next()){

out.println("Login Succesful! A record with the given user name and password exists");

}

else {

out.println("Login Failed. No records exists with the given user name and password");

}

myResult.close();

statement.close();

myConn.close();

}

catch(Exception e){out.println(e);

}

%>

</body>

</html>

i have given the driver connection through odbc

but i get an exception as follows

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

could you please help me with this bug..

thank you

[1697 byte] By [neeophytea] at [2007-10-3 5:57:33]
# 1
did you try to setup the odbc of your workstation?
jgalacambraa at 2007-7-15 0:38:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
do u mean setting the driver connection through the administrative tools..microsoft access driver..n selecting the database..this is wat i have done..
neeophytea at 2007-7-15 0:38:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
i mean setting the odbc on the administrative tools/Data Sources(ODBC)
jgalacambraa at 2007-7-15 0:38:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
yes i have set the connection for odbc through the administrative tools
neeophytea at 2007-7-15 0:38:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Connection myConn = DriverManager.getConnection("jdbc:odbc:DatasourceName","username","password");i only use the above code
jgalacambraa at 2007-7-15 0:38:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

i replaced

Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={login (login.mdb)};DBQ=C:/Program Files/Apache Tomcat 4.0/webapps/examples/jsp/sampless/login.mdb");

with the statement u provided

ie

Connection myConn = DriverManager.getConnection("jdbc:odbc:login","username","password");

now am getting another exception

java.sql.SQLException: Driver does not support this function

neeophytea at 2007-7-15 0:38:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...