/Users/lyon/j4p/src/net/server/servlets/LoginSQL.java

1    package net.server.servlets; 
2     
3    /** 
4     *  LoginSQL Class 
5     */ 
6     
7    public final class LoginSQL { 
8     
9        public static String userTable = "user"; 
10    
11       /** 
12        * Don't let anyone instantiate this class. 
13        */ 
14    
15       private LoginSQL() { 
16       } 
17    
18    
19       /** 
20        * Returns the SQL Select statement to validate the UserId & Password 
21        * 
22        * @return          String          Sql 
23        */ 
24    
25       public static String getLoginScript(String user, String password) { 
26           return "Select * From " 
27                   + userTable + " " 
28                   + "Where" + " " 
29                   + "UserId = " + "\'" + user + "\'" + " " 
30                   + "And" + " " 
31                   + "Password = " + "\'" + password + "\'"; 
32       } 
33    
34   } 
35