----- Original Message -----
From: Andreas <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 19, 1999 11:13 AM
Subject: Login servlet that connects to Acces DB.


> Does anybody have a simple example of a servlet that connects to an MS
> Access in order to verify login?

A servlet would connect the same way as an applet and an application.

public void openConnection() {
   try {
      java.sql.Driver drv                    = driverInstance();
      java.sql.Connection connection =
java.sql.DriverManager.getConnection(fieldDatabase,fieldUser,password);
      java.sql.Statement statement      = connection.createStatement();
  }
 catch(java.lang.Exception e) { }
}

public java.sql.Driver driverInstance() {
   try

   return (java.sql.Driver) Class.forName driver.newInstance();
   }
   catch (java.lang.Exception e) {
    return null;
   }
}

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to