How to compare the codes written in two different windows?

Hi ,
I have a long code written for a FM.
Now I have got the same code in a notepad.
I want to check weather the codes in the two windows are exactly alike.
Is there any easy way to do this?

hi Harshit Rungta ,
T-code SE39 - ABAP split screen editor use to compare 2 different programs ,function modules ,class
just create a function module that available in notepad and compare the code which u have already .
choose the function radio button while checking the function module .
regards
chinnaiya

Similar Messages

  • How to compare the *.so files of two different directories?

    Good morning,
    I am working in a software development company that works as follows:
    - we have a platform, that consists of a list of *.so files.
    - we deliver a product, based on that platform, that also consists of a list of *.so files.
    - all our sources are managed via Clearcase.
    Now I have the following situation:
    - we have created a new Clearcase view, where we (should have) all correct sources. These have been compiled, resulting in a list of *.so files.
    - we have a copy of the product that we have delivered at the client.
    I would like to verify whether the *.so files of the new Clearcase view are the same as the ones that have been delivered to the client.
    Why is this such a problem?
    - I could check the "cksum" result, but as the Solaris command "cksum" takes into account the compilation date, I have different "cksum" results for *.so files that are basically equal.
    - I could check the filesize, but a small change in a source might change the behaviour of the *.so file but not necessarily its filesize.
    - I could check the "what" result (the "C Compilation System" "what" command), which gives the Clearcase status, so that I can check whether the same Clearcase versions have been delivered, but while doing this, I have seen that *.so files have been delivered, the sources of which were checked OUT (!), so also this does not give me any certainty.
    - In addition, it is possible that there is a change in the platform components, resulting in a different product specific *.so file, which however does not mean that the behaviour of the product specific *.so file is different.
    Therefore I am looking for another way of comparing two binary *.so files, in order for me to judge the correctness of the new Clearcase view.
    Does anybody have an idea?
    Thanks
    Dominique

    Thanks Alan for the fast response,
    Unfortunately, I don't have "elfsign" on my system and reading more about the command, I have the impression that this command can verify whether a signature is correct, but in order to do so, the file needs to be signed before, which is not the case here.
    Do you have other suggestions?
    Thanks
    Dominique
    P.s. yesterday, another issue popped up: the *.so files I am referring to are compiled from a whole list of files, and it seems that the "what" command can only check the Clearcase history of the hole list, while in our department, mostly only the impacted files are checked out/checked in for doing an update, and not the hole list of files, causing the "what" command to give erroneous results.

  • How to display the entire application in two different languages in apex

    Hi,
    How to display the entire application in two different languages in apex...
    For example i need to display each item in both English and Hindi..
    To achieve this initially i have the select the language otherwise the item label alone ll be displayed in both languages ...
    Anyhow how it ll be apex is it possible
    Regards,
    Pavan

    Hi pars,
    http://www.packtpub.com/sites/default/files/1346-chapter-6-creating-multilingual-apex-applications.pdf?utm_source=packtp…
    In this link also i struck in
    In page 10  of that document
    The application is now ready to be translated. Everything is in place to run it in any language imaginable.To ca ll the application in another language, change the URL of your application to the following:
    http://yourdomain:port/pls/apex/f?p=&APP_ID.:&PAGE_ID.:&SESSION_ID.:LANG:NO::FSP_LANGUAGE_PREFERENCE:nl
    This example will call the chosen page in the application and show it in the Dutch language instead of in English. To select another language change the property nl at the end of the URL to your desired language code.
    Thanks alot for ur suggestions.kindly provide more inputs..............

  • How to use the code written in App.Xaml.cs in Windows Phone 8 in Windows Phone 8.1 Universal Apps

    i have a App.xaml.cs file in Windows Phone 8.0 , amd i want to use the code in that file to make work with App.xaml.cs file in Windows Phone 8.1 Universal Apps
    My Windows Phone 8 App.xaml.cs file is like as below
    namespace OnlineVideos
    public partial class App : Application
    #region Initialization
    public static dynamic group = default(dynamic);
    public static dynamic grouptelugu = default(dynamic);
    public static ShowList webinfo = default(ShowList);
    public static WebInformation webinfotable = new WebInformation();
    AppInitialize objCustomSetting;
    IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
    DispatcherTimer timer;
    IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
    public static bool AdStatus = false;
    public App()
    UnhandledException += Application_UnhandledException;
    if (System.Diagnostics.Debugger.IsAttached)
    Application.Current.Host.Settings.EnableFrameRateCounter = true;
    //RootFrame.UriMapper = Resources["UriMapper"] as UriMapper;
    AppSettings.NavigationID = false;
    objCustomSetting = new AppInitialize();
    timer = new DispatcherTimer();
    Constants.DownloadTimer = timer;
    InitializeComponent();
    InitializePhoneApplication();
    #endregion
    #region "Private Methods"
    void StartDownloadingShows()
    timer.Interval = TimeSpan.FromSeconds(10);
    timer.Tick += new EventHandler(timer_Tick);
    timer.Start();
    void timer_Tick(object sender, EventArgs e)
    try
    BackgroundWorker worker = new BackgroundWorker();
    worker.DoWork += new DoWorkEventHandler(StartBackgroundDownload);
    worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
    worker.RunWorkerAsync();
    catch (Exception)
    void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    if (AppSettings.StopTimer == "True")
    timer.Stop();
    AppSettings.StopTimer = "False";
    async void StartBackgroundDownload(object sender, DoWorkEventArgs e)
    switch (AppSettings.BackgroundAgentStatus)
    case SyncAgentStatus.DownloadFavourites:
    if (AppSettings.DownloadFavCompleted == false && AppSettings.SkyDriveLogin == true)
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    timer.Stop();
    ReStoreFavourites reStoreFav = new ReStoreFavourites();
    await reStoreFav.RestorefavFolder(ResourceHelper.ProjectName);
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.UploadFavourites;
    timer.Start();
    else
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.UploadFavourites;
    break;
    case SyncAgentStatus.UploadFavourites:
    bool result = Task.Run(async () => await Storage.FavouriteFileExists("Favourites.xml")).Result;
    if (AppSettings.SkyDriveLogin == true && result)
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    timer.Stop();
    UploadFavourites upLoad = new UploadFavourites();
    await upLoad.CreateFolderForFav(ResourceHelper.ProjectName);
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.DownloadParentalControlPreferences;
    timer.Start();
    else
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.DownloadParentalControlPreferences;
    break;
    case SyncAgentStatus.RestoreStory:
    if (AppSettings.DownloadStoryCompleted == false && AppSettings.SkyDriveLogin == true && (ResourceHelper.ProjectName == "Story Time" || ResourceHelper.ProjectName == "Vedic Library"))
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    timer.Stop();
    RestoreStory restore = new RestoreStory();
    //if (ResourceHelper.ProjectName == "Story Time")
    await restore.RestoreFolder("StoryRecordings");
    //else
    // await restore.RestoreFolder("VedicRecordings");
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.UploadStory;
    timer.Start();
    else
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.UploadStory;
    break;
    case SyncAgentStatus.UploadStory:
    if (AppSettings.SkyDriveLogin == true && (ResourceHelper.ProjectName == "Story Time" || ResourceHelper.ProjectName == "Vedic Library"))
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    timer.Stop();
    UploadStory st = new UploadStory();
    //if (ResourceHelper.ProjectName == "Story Time")
    await st.CreateFolder("StoryRecordings");
    //else
    // await st.CreateFolder("VedicRecordings");
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.DownloadFavourites;
    timer.Start();
    else
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.DownloadFavourites;
    break;
    default:
    ShowDownloader.StartBackgroundDownload(timer);
    break;
    #endregion
    #region "Application Events"
    private void pop_Opened_1(object sender, EventArgs e)
    DispatcherTimer timer1 = new DispatcherTimer();
    timer1.Interval = TimeSpan.FromSeconds(5);
    timer1.Tick += timer1_Tick;
    timer1.Start();
    void timer1_Tick(object sender, EventArgs e)
    (sender as DispatcherTimer).Stop();
    Border frameBorder = (Border)VisualTreeHelper.GetChild(Application.Current.RootVisual, 0);
    Popup Adc = frameBorder.FindName("pop") as Popup;
    Adc.IsOpen = false;
    private void Application_Launching(object sender, LaunchingEventArgs e)
    SQLite.SQLiteAsyncConnection conn = new SQLite.SQLiteAsyncConnection(Constants.DataBaseConnectionstringForSqlite);
    Constants.connection = conn;
    AppSettings.AppStatus = ApplicationStatus.Launching;
    AppSettings.StopTimer = "False";
    objCustomSetting.CheckElementSection();
    SyncButton.Login();
    if (AppSettings.IsNewVersion == true)
    AppSettings.RatingUserName = AppResources.RatingUserName;
    AppSettings.RatingPassword = AppResources.RatingPassword;
    AppSettings.ShowsRatingBlogUrl = AppResources.ShowsRatingBlogUrl;
    if (ResourceHelper.AppName == Apps.Online_Education.ToString() || ResourceHelper.AppName == Apps.DrivingTest.ToString())
    AppSettings.QuizRatingBlogUrl = AppResources.QuizRatingBlogUrl;
    AppSettings.LinksRatingBlogUrl = AppResources.LinksRatingBlogUrl;
    AppSettings.ShowsRatingBlogName = AppResources.ShowsRatingBlogName;
    AppSettings.LinksRatingBlogName = AppResources.LinksRatingBlogName;
    if (ResourceHelper.AppName == Apps.Online_Education.ToString() || ResourceHelper.AppName == Apps.DrivingTest.ToString())
    AppSettings.QuizLinksRatingBlogName = AppResources.QuizLinksRatingBlogName;
    Constants.UIThread = true;
    group=OnlineShow.GetTopRatedShows().Items;
    grouptelugu = OnlineShow.GetRecentlyAddedShows().Items;
    Constants.UIThread = false;
    StartDownloadingShows();
    private void Application_Activated(object sender, ActivatedEventArgs e)
    AppSettings.AppStatus = ApplicationStatus.Active;
    if (ResourceHelper.AppName == Apps.Kids_TV_Pro.ToString())
    AppSettings.ShowAdControl = false;
    private void Application_Deactivated(object sender, DeactivatedEventArgs e)
    AppSettings.AppStatus = ApplicationStatus.Deactive;
    AppState.RingtoneStatus = "TombStoned";
    private void Application_Closing(object sender, ClosingEventArgs e)
    AppSettings.AppStatus = ApplicationStatus.Closing;
    private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
    FlurryWP8SDK.Api.LogError("Error at Application_UnhandledException in App.xaml.cs", e.ExceptionObject.InnerException);
    if (System.Diagnostics.Debugger.IsAttached)
    System.Diagnostics.Debugger.Break();
    else
    Exceptions.SaveOrSendExceptions("Exception in Application_UnhandledException Method In App.xaml.cs file.", e.ExceptionObject);
    e.Handled = true;
    return;
    #endregion
    #region Phone application initialization
    public PhoneApplicationFrame RootFrame { get; private set; }
    // Avoid double-initialization
    private bool phoneApplicationInitialized = false;
    // Do not add any additional code to this method
    private void InitializePhoneApplication()
    if (phoneApplicationInitialized)
    return;
    // Create the frame but don't set it as RootVisual yet; this allows the splash
    // screen to remain active until the application is ready to render.
    RootFrame = new PhoneApplicationFrame();
    if (App.Current.Resources["AdVisible"] as string == "True")
    RootFrame.Style = App.Current.Resources["RootFrameStyle"] as Style;
    RootFrame.ApplyTemplate();
    RootFrame.Navigated += CompleteInitializePhoneApplication;
    // Handle navigation failures
    RootFrame.NavigationFailed += RootFrame_NavigationFailed;
    // Ensure we don't initialize again
    phoneApplicationInitialized = true;
    //NonLinearNavigationService.Instance.Initialize(RootFrame);
    private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
    if (System.Diagnostics.Debugger.IsAttached)
    System.Diagnostics.Debugger.Break();
    else
    Exceptions.SaveOrSendExceptions("Exception in RootFrame_NavigationFailed Method In App.xaml.cs file.", e.Exception);
    e.Handled = true;
    return;
    // Do not add any additional code to this method
    private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
    // Set the root visual to allow the application to render
    if (RootVisual != RootFrame)
    RootVisual = RootFrame;
    // Remove this handler since it is no longer needed
    RootFrame.Navigated -= CompleteInitializePhoneApplication;
    #endregion
    Mohan Rajesh Komatlapalli

    Basically you are asking as how to port silverlight to Xaml (RT). Go one by one converting each API from silverlight to XAML, like IsolatedStorage isn't there in RT, so look for its alternative etc.
    See here the namespace/class mappings : Windows Phone Silverlight to Windows Runtime namespace and class mappings
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • How to compare table data available in two different databases

    Hi,
    I need to compare two tables data in available in two databases - how easly I can do that .. I have Table A in Database A and Table A in Database B which is snapshot of DB A.TableA - but here are some discrepencies now I need to match two tables .. but no extra space available, so no exp imp.
    Thanks in advance,
    Chitrasen

    HI,
    What is the difference that you are looking for, if it si for some records missing in some tables you could use MINUS and get the output. IF you are looking to compare the TABLE structure then you could look into the datadictionary VIEWS of both the database's and check the difference.
    Thanks

  • How to compare the query definiation of two or more queries?

    HI Folks.
    I am attempting to determine if there is a method by which I can compare query definination of two or more queries or shows me the differences between queries. 
    Transaction RSRTQ only give the query details of single query at a time and doesnot do a comparison.
    Please let me know a method to undertake this?
    Thanks
    Uday

    There is no straight way of doing this:
    I normally open the definitions in 2 sessions and compare them manually.
    Hope this helps

  • Urgent ! Assigning (or Linking ) the same workbook into two different roles

    Hi Gurus,
    Coul you tell how to link the same workbook to two different roles.
    I am assigning the same workbook to two different roles, but in the second role the workbook is displaying with different structure than in the first role. I want the workbook should be displayed with same structure in both the roles.
    This is Urgernt.
    Thanks in advance.
    Best regards
    Hari

    Hello hari,
    Both the roles should diplay the same layout for a single workbook.
    please ensure that both the users(with these 2 roles) have similar (all the other)authorisations.
    it's possible that one of the users may have further restrictions in authorisations. check out for z-authorisation objects if any.
    hope it helps..
    thanks,
    (*Don't forget to Assign points on SDN)

  • How compare the code between two tracks in NWDS

    Hi
    We have NW04 Sp18 Portal with MSS & ESS Sp13.At present version we have made lot of custom changes.
    Now we have to upgrade ESS to Sp14. As per the JDI cook book we are going to create new track.
    After that how will we implement the custom changes to the new source code?
    Is there any way to compare the changes between these two tracks to implement the old custom changes to the new source code?
    Any tools available in NWDS to do this
    Its urgent please give your valuable information
    Thanks & Regards
    Gopal

    Hi Gopala,
    You won't like this answer, but unless you have documented all your changes very accurately, as far as I know it's basically the only option you have. Check out the content of both tracks and use a good diff tool to check the differences. Personally I use [WinMerge|http://winmerge.org/]
    Kind regards,
    /Sigiswald

  • How to compare the contents of two different tables

    hello. can somebody give me an idean on how to compare the contents of two different tables in mysql?
    example, i have a table named Main List and a table named New List.
    The contents of the New List should be compared to the contents of the
    Main List, to check if they are equal. I don't have any idea how to manipulate
    this data. Hoping for your help. Thanks.

    it is better to comapre it using java.. try get the resultset first and store that in collections then comapre the two collections

  • How to compare the programs in two different systems

    Hi,
    I have two systems say A & B and i have the program say 'Z_TESTPROG'.
    How to compare the program in two different systems.
    Regards,
    Venkat

    Hi,
    Check the version in Utilities -> version -> version management in both servers is one option.
    Another one is using SE39 transaction.
    Regards
    Manasa

  • Comparing the creation time of two jars.

    Hi,
    My requirement is that i need to compare the creation time of two of the jars and see which one of the jar is the latest.
    I did it using the following code i get the output in the form of strings so i cant compare them to find which one is the latest.
    import java.io.*;
    import java.util.*;
    public class FileTest {
         public static void main(String args[]) {
              File devbuild = new File(
                        "\\\\devspace\\dev$\\ReleaseEng\\DEVbuilds\\tw_enterprise\\build\\jboss\\Oracle\\Twelibrary.jar");
              File local = new File(
                        "D:\\jboss-4.2.1.GA\\server\\TWEServer\\Twelibrary.jar");
              Calendar now = Calendar.getInstance();
              int currtime = now.get(Calendar.HOUR_OF_DAY);
              int maxtime = 18;
              System.out.println("Before the while loop");
              while (currtime < maxtime) {
                   System.out.println("Inside the while loop");
                   if (devbuild.exists()) {
                        try {
                             // get runtime environment and execute child process
                             Runtime systemShell = Runtime.getRuntime();
                             BufferedReader br1 = new BufferedReader(
                                       new InputStreamReader(new FileInputStream(devbuild)));
                             BufferedReader br2 = new BufferedReader(
                                       new InputStreamReader(new FileInputStream(local)));
                             Process output = systemShell.exec("cmd /c dir " + devbuild);
                             Process output1 = systemShell.exec("cmd /c dir " + local);
                             // open reader to get output from process
                             BufferedReader br = new BufferedReader(
                                       new InputStreamReader(output.getInputStream()));
                             BufferedReader br3 = new BufferedReader(
                                       new InputStreamReader(output1.getInputStream()));
                             String out = "";
                             String out1 = "";
                             String line = null;
                             String line1 = null;
                             int step = 1;
                             int step1 = 2;
                             while ((line = br.readLine()) != null) {
                                  if (step == 6) {
                                       out = line;
                                  step++;
                             } // display process output
                             while ((line1 = br3.readLine()) != null) {
                                  if (step1 == 6) {
                                       out1 = line1;
                                  step1++;
                             try {
                                  out = out.replaceAll(" ", "");
                                  out1 = out1.replaceAll(" ", "");
                                  System.out.println("CreationDate: "
                                            + out.substring(0, 10));
                                  System.out.println("CreationTime: "
                                            + out.substring(10, 16) + "m");
                                  System.out.println("CreationDate: "
                                            + out1.substring(0, 10));
                                  System.out.println("CreationTime: "
                                            + out1.substring(10, 16) + "m");
                             } catch (StringIndexOutOfBoundsException se) {
                                  System.out.println("File not found");
                             //Long modifiedtime = devbuild.lastModified();
                             //long oldtime = old.lastModified();
                             int devbuilddate = Integer.parseInt(out.substring(0, 10));
                             int devbuildtime = Integer.parseInt(out.substring(10, 16));
                             int localbuilddate = Integer.parseInt(out1.substring(0, 10));
                             int localbuildtime = Integer.parseInt(out1.substring(10, 16));
                             if (devbuilddate >= localbuilddate && devbuildtime >= localbuildtime) {
                                  System.out.println("The Build date is Later than the one i am having--->");
                                  System.exit(6);
                             } else {
                                  System.exit(0);
                        } catch (Exception e) {
                             e.printStackTrace();
                   if (currtime > maxtime) {
                        System.exit(5);
    How can i do it?
    Can anyone help me out in this.
    Thanks,
    Kavipriya.

    Hi Clap,
    Thanks for ur reply. Let me say you the scenario clearly. We are in the process of automating some of the process. We have builds running daily night and our automation will run using that build.
    Currently the build which is getting generated does have manifest in it. For our automation framework we cant suggest adding the manifest. Which will not be agreed.
    Our automation will be checking till 10.am. to check whether the build is ready if not it will come out of the loop. If the build is avaialble within 10 then it will take the build and see whetehr the creation date and time of the build and the one i am having locally or different. If diff it will see whether the build generated is latest than the one i am having.
    If it so then the process will run.
    So hope you got my issue.

  • How to refer the trigger written in one form from another form ?

    How to refer the trigger written in one form from another form ?
    Thanks,
    Ravi Shankar

    Try to convert the PL/SQL code from Forms trigger into a PL/SQL library(.PLL),
    and then attach that PLL in your forms.
    Note that all Forms objects should be referenced indirectly, for example,
    you have to rewrite
    :B1.DEPT_CODE := :B2.DEPT_CODE;
    :B3.TOTAL_AMOUNT := 100;
    ==>
    copy('B2.DEPT_NO','B1.DEPT_NO');
    copy('100','B3.TOTAL_AMOUNT');
    This is the best way to share PL/SQL code among Oracle Forms.

  • How to find the structural difference between two tables

    Hi all,
    How to find the structural difference between two tables .
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    Thanks,
    P Prakash

    you could try something similar to this, for each table pair that you want to compare:
    SELECT 'TABLE_A has these columns that are not in TABLE_B', DIFF.*
      FROM (
            SELECT  COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_A'
             MINUS
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_B'
          ) DIFF
    UNION
    SELECT 'TABLE_B has these columns that are not in TABLE_A', DIFF.*
      FROM (
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_B'
             MINUS
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_A'
          ) DIFF;that's assuming, column_name, data_type and data_length are all you want to compare on.

  • LSMW VD51 , Validations in Begin of Transaction; how to Debug the code?

    Hi All,
    I have written code for validations i Begin of Transaction in the field mapping 5th step of LSMW for VD51.
    Now this code not getting triggered at the time of Conversion of Data. How to debug the code. I have put a static break point 'BREAK-POINT' still not getting triggered.
    Any suggestion / solution for this issue.
    Thanks and Regards,
    Narsimha Kulkarni

    Hi Narshimha,
    Make any mapping error during mapping and check the syntax of mapping it will drag you to the lsmw report there you can put your break point. You can check the report name from transaction code as well.
    Remember this mapping block will execute when you execute the step Convert Data in LSMW.
    Regards
    Dhirendra

  • How to compare the value of a specied attribute to a string

    I am looking for an example of how to compare the value of an attribute to a string. (I think)
    I have been trying to:
    if (attrs.get("title")== "Vampire") -- you already know this did not work.
    How can I check to see if the title="Vampire"?
    The code below will get me the title of admin (which should be Vampire)
    import javax.naming.Context;
    import javax.naming.directory.InitialDirContext;
    import javax.naming.directory.DirContext;
    import javax.naming.directory.Attributes;
    import javax.naming.NamingException;
    import java.util.Hashtable;
    class Giles {                  
    public static void main(String[] args) {
              Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
         "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://192.168.1.55:389/o=sunnydale");
         try {                                                                     
         DirContext ctx = new InitialDirContext(env);
         Attributes attrs = ctx.getAttributes("cn=admin");
         System.out.println("Title: " + attrs.get("title").get());
         ctx.close();
         } catch (NamingException e) {                                     
         System.err.println("Problem getting attribute: " + e);
    Thank you!!
    Steve

    I guess, you are looking for searching for attributes of an user object.
    Here is the sample code to list all the attributes of an 'user' objectclass.
    Tell me if it helps or not.
    import java.util.Hashtable;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    import javax.naming.*;
    public class GetAttributes
         public static void main (String[] args)
              Hashtable env = new Hashtable();
              //Must use either the userPrincipalName or samAccountName,
              //Cannot use the distinguished name
              String adminName = "cn=abcd,cn=Users,dc=ssotest,dc=com";
              String adminPassword = "DEF1234";
              String ldapURL = "ldap://pni3w067:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   // Create the initial directory context
                   DirContext ctx = new InitialLdapContext(env,null);
                   // Create the search controls
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user))";
                   //Specify the Base for the search
                   //cn=policygroup,ou=policyusers,ou=ssoanay,;
                   //String searchBase = "ou=policyusers,ou=ssoanay,dc=ssotest,dc=com";
                   String searchBase = "cn=abcd,cn=users,dc=ssotest,dc=com";
                   //initialize counter to total the results
                   int totalResults = 0;
                   // Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        totalResults++;
                        System.out.println("\nName of Object : " + sr.getName());
                        // Print out some of the attributes, catch the exception if the attributes have no values
                        Attributes attrs = sr.getAttributes();
                        //System.out.println("6");
                        if (attrs != null) {
                             try {
                                  /*NamingEnumeration enum = attrs.getIDs();
                                  while(enum.hasMore()) {
                                       System.out.println("IDs:"+enum.next().toString());
                                  NamingEnumeration enum2 = attrs.getAll();
                                  while(enum2.hasMore()) {
                                       System.out.println("Attribute - "+enum2.next().toString());
                             catch (Exception e)     {
                                  System.out.println("Exception:" +e.getMessage());
                        else {
                             System.out.println("attribute is null");
                   System.out.println("Total results: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                        System.err.println("Problem searching directory: " + e);
         //return 0;
    }

Maybe you are looking for

  • IMac random shutdown w/10.6.7 update

    I'm also noticing some weirdness today after installing 6.7 yesterday. My 2006 iMac would not wake up from sleeping last night - requiring a hard reboot. I held the restart button in back down for an unusually long time before the white light in fron

  • Streaming into TV

    I currently watch the CBS News on my MacBook Pro.  I have a Smart TV that connects to my newwork but it cannot stream the news when I go to the CBS website.  Is there a way that I can stream the news from my MacBookPro into the TV via my WiFi (Airpor

  • Whenever I go on safari my iPod says my flash player needs to be updated

    I wanted to search up something on google and I just see WARNING: your flash player might have expired please install adobe flash player

  • Convert comma, Tab delimited paste?

    I am trying to give Numbers a try. I often copy text from an email and paste it in to an Excel spreadsheet and format it using the text import wizard. I can't find any reference in Numbers help to try to do this. Is there a way to format copied text

  • Need info regarding Contracts

    Hi All, Please provide me information regarding the standard database tables that store the details of contracts at Header level and Item level created using the transaction crmd_order. All helpful answers will be rewarded. Regards, Udaya