ps = con.prepareStatement("select distinct username from HardTokenData where  tokenSN LIKE '" + searchpattern + "%'");
ps = con.prepareStatement("select distinct username from HardTokenData where  tokenSN LIKE '%" + searchpattern + "%'");
    public Collection findHardTokenByTokenSerialNumber(Admin admin, String searchpattern){    	debug(">findHardTokenByTokenSerialNumber()");    	ArrayList returnval = new ArrayList();    	Connection con = null;    	PreparedStatement ps = null;    	ResultSet rs = null;    	try{    		// Construct SQL query.    		con = JDBCUtil.getDBConnection(JNDINames.DATASOURCE);    		ps = con.prepareStatement("select distinct username from HardTokenData where  tokenSN LIKE '" + searchpattern + "%'");    		// Execute query.    		rs = ps.executeQuery();    		// Assemble result.    		while(rs.next() && returnval.size() <= UserAdminConstants.MAXIMUM_QUERY_ROWCOUNT){    			returnval.add(rs.getString(1));    		}    		debug("<findHardTokenByTokenSerialNumber()");    		return returnval;    	}catch(Exception e){    		throw new EJBException(e);    	}finally{            JDBCUtil.close(con, ps, rs);    	}    }