Rupesh,
    I have tried looking and doing a search at the java.sun.com site and my
effort has been to no avail----not finding any file by the
name("jcrypt.java").  If you the url you used or that piece code laying around
could you please pop it out to me.  Thanks again.

Cheers

Pat
Rupesh Choubey wrote:

> sun has some code lying around....called jcrypt.java
> sorry i dont have it but you could do a search on their site....
> it does what u look for.....
>
> -----Original Message-----
> From: patrick lurlay [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 05, 1999 11:13 PM
> To: [EMAIL PROTECTED]
> Subject: Question/suggestions
>
> Hello again.
>       Thanks everyone for the suggestion.  it works. I do have one quick
> question----does any one have a pice of code that I can use or take a
> look at or use as an example.  I need to encrypt user password before
> inserting them into the database.  see code snipet below.
>
> Cheers
>
> Pat
>
> public boolean validateUser(String username, String userpassword)
>  {
>          String dbuserid = "";
>          String dbpasswd = "";
>          boolean isValidUser = false;
>          try
>             {
>                 Class.forName("oracle.jdbc.driver.OracleDriver");
>             }
>                 catch(java.lang.ClassNotFoundException e)
>                 {
>                   System.err.print("ClassNotFoundException:");
>                   System.err.println(e.getMessage());
>        }
>
>          try
>            {
>            //DriverManager.registerDriver(new
> oracle.jdbc.driver.OracleDriver());
>            Connection conn = DriverManager.getConnection(
>            "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS="+
>            "(PROTOCOL = TCP)(HOST = fred)"+
>            "(PORT = 1521)))(CONNECT_DATA = (SID =ORA)))",
>            "dev_user","dev_user");
>
>            // Create a Statement and create a query string!
>              String query = "SELECT  USERNAME, PASSWORD FROM USERLOGIN"
> +
>                             " where USERNAME = '" + username +
>                             "' and PASSWORD = '" + userpassword + "'";
>                   Statement stmt = conn.createStatement();
>                   ResultSet rst = stmt.executeQuery(query);
>
>                if (rst.next()) {
>                dbuserid = rst.getString(1);
>                dbpasswd = rst.getString(2);
>              }
>              if ( username.equals(dbuserid.trim()) &&
> userpassword.equals(dbpasswd.trim()) )
>              {
>                  //We have a successful match of input userid and
>                  //password with a database rec.
>                  isValidUser = true;
>                 } else {
>                         //we did not succeed
>                         isValidUser = false;
>                 }
>
>             stmt.close();
>             conn.close();
>            } catch(SQLException ex) {
>                 System.out.println("SQLException: " + ex.getMessage());
>            }
>            return isValidUser;
>           }
>         }
>
> ___________________________________________________________________________
> 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
>
> ___________________________________________________________________________
> 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

___________________________________________________________________________
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