1 package de.webman.acl.eventhandler; 2 3 import java.sql.*; 4 5 import com.teamkonzept.lib.*; 6 import com.teamkonzept.db.*; 7 import com.teamkonzept.webman.mainint.*; 8 import de.webman.acl.db.queries.GetLoginByName; 9 13 public class ACUtils 14 { 15 20 public static boolean checkLoginExistance(String login) throws SQLException 21 { 22 return checkLoginExistance(login, new Integer (-1)); 23 } 24 25 32 public static boolean checkLoginExistance(String login, Integer id) throws SQLException 33 { 34 TKQuery q; 35 q = (TKPrepQuery)TKDBManager.newQuery(GetLoginByName.class); 36 q.setQueryParams( "LOGIN", login); 37 q.setQueryParams( "USER_ID", id); 38 q.execute(); 39 ResultSet rs = q.fetchResultSet(); 40 if (rs == null || !rs.next()) 41 return false; 42 return true; 43 } 44 } | Popular Tags |