How to find out class name

Hi folks,
Can anybody help me, I got stuck on this problem.
I need to find out the className of the class, which is specified
by ordinary filename.
In other words:
User gives me filename (something.class) and I need to find out
classname (I just need to create an instance of this class)
Thanks a lot.
sgtPepper

This will read the class name from a class file.
* @author Ian Schneider
public class JavaClassName {
    public static void main(String[] args) throws Exception {
        DataInputStream din = new DataInputStream(new FileInputStream(args[0]));
        int cafebabe = din.readInt();
        if (cafebabe != 0xcafebabe)
            throw new Exception("Not class file");
        din.skip(4);
        int cnt = din.readShort() - 1;
        Object[] info = new Object[cnt];
        for (int i = 0; i < cnt; i++) {
            int b = din.readByte();
            switch (b) {
                case 1:
                    info[i] = din.readUTF(); break;
                case 3: case 4: case 9: case 10: case 11: case 12:
                    din.skip(4); break;
                case 5: case 6:
                    i++;
                    din.skip(8); break;
                case 7: case 8:
                    info[i] = Short.valueOf(din.readShort()); break;
                default:
                    assert false;
        din.skip(2);
        int off = din.readShort();
        Number ptr = (Number) info[off - 1];
        System.out.println(info[ptr.intValue() - 1]);
        din.close();
}

Similar Messages

  • How to find out server name in reports9i

    hi all
    how to find out server name in reports9i
    i need the report server name to call a report
    thanks
    Edited by: vikas singhal on Nov 5, 2008 1:02 AM

    You do not need to do anything, if your Report server is on the same machine as the Forms server (which is usually the case) you simply use the url as
    /reports/rwservlet?report=myreport' and the server will automatically use the default report server.
    then you simply use
    web.show_document('/reports/rwservlet?userid=scott/tiger@orcl&report=myreport&desformat=htmlcss&desname=test.html'Tony
    Try it now
    Edited by: Tony Garabedian on Nov 5, 2008 2:00 PM

  • How to find out query name using Elements of the query builder.

    Hi SDNers,
    how to find out query name using Elements of the query .
    thanks,
    satyaa

    Hi,
    For having a look at the relation between BEx tables,check the link below:
    http://wiki.sdn.sap.com/wiki/display/BI/ExploretherelationbetweenBEx+Tables
    -Vikram

  • How to find out Db name of perticular web application in sharepoint 2010

    how to find out Db name of perticular web application in sharepoint 2010 to take a backup from sql

    1.  Open the SharePoint 2010 Central Admin application.
    2.  On the SharePoint central administration website, click Application Management.
    3.  In the Databases section, click Manage Content Databases.
    4.  On the Manage Content Databases page, select a web application by clicking the Web Applications drop-down list and choosing a web application.
    5.  Can notice the  available database names for the webapplication. ******************************************************************************************
    Please remember to mark your question as answered &Vote helpful, if this solves/helps your problem
    s p kumar

  • How to find the class name of the  BO

    HI
      How to find out a class for a business object.
    For example for the Business Object FORMABSENC i want to find out the class name.
    iam not able to find out from se24 or swo1.
    Or please suggest me how can i use the method createbapistructure of this businessobject.
    Regards
    vijaya

    Hello Vijay
    When you double-click on "method" AbsenceForm.CreateBapiStructure (transaction SWO1) and switch to tab ABAP you see (on ERP 6.0) that the field Name is empty meaning this BO "method" has not yet been implemented.
    Other methods are implemented by modules of function group SWXA. Checking package SWX you will see that there are no suitable classes around for this object.
    Final remark: Methods of business objects has just a semantic meaning and has nothing to do with object orientation (i.e. classes).
    Regards
      Uwe

  • How to find out table name for the field in the webUI

    Hi.
    I am in CRM2007.
    So i go to the transaction code    BSP_WD_CMPWB
    In that i provide the component name as CRM_UI_FRAME.
    I press the Test button.
    So, it opend the WebUI.
    I want how to find out table of the particular input field?
    I mean from which table the data is retrived how to find out?
    When i enter some thing in the input field how to find out in which table that data is stored?
    By pressing F2 on the input field it opend View and Component Name.
    I want find out table of that particular field. How to find it?
    If anybody know about this explain it with Screen shorts if possible.
    Thank You.
    Krishna. B.

    hi
    goto tx genil_model_browser. Suppose you want to find fields reated to your order header eg sold to name. In component set write all and press F8. Then goto access object and in access object click on node BTAdminH. Click on attribute structure. Here you will find structure and attributes. If you click relationship then you will see all the relationship wrt btadminh. open any r/s that you require. and click on other object and attribute. You will get to know the structure.
    Best regards
    Pankaj kumar

  • How to find out the name of a table?

    Hi
    How can I find out the name of a table which doesn't have a record history?
    Regards
    Rahman

    No direct way to know the tables. What you will find on the ABout this page link are the View Object (similar to record sets), Entity objects, controller and Application module. Generally EO is based on a table or the VO can be based on the query which you can find the corresponding xml file. But a button action might be calling a method in AM or CO which in turn call some wrapper method to interact with database. So nothing straight forward. You will have to analyze the all page related code objects.
    They are specific to OA framework and if you are not aware about them, better go through the initial chapters of OAF dev guide.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to find out program name to the corresponding output type of invoice..

    hi ALL,
    I want to findout program name to my output type.
    For one invoice functional peoples are configured. Here i know the outtype. But i don't know the program name .
    Can any body please tell me how to find out the program name for the output type..?

    Hi,
    Goto NACE t-code
    Select Billing (V3)
    Press 'Output Types' Button
    In the next screen select the corresponding output type you want.
    Then press 'Processing Routines' in the left pane. You can see the program name
    Cheers,
    Kothand

  • How to Find out the Name of the Table in Data Sources

    Hi All,
    How Can i find out the table names used in data Sources.
    For EX. Suppose I want to find out the table Names  in R3 Used In GL Data Source 0FI_GL_4.
    Thanks in Advance.
    Vaibhav A

    Hi,
    Usefull link:
    https://wiki.sdn.sap.com/wiki/display/BI/BW%20SD%20MM%20FI%20DATASOURCES
    Regards.

  • How to find out query name in customer exit for variables

    We use the same customer exit variable in different queries. In the customer exit we want to find out, which query has called the customer exit. With the technical query name we want to read a master data table entry.
    e.g. If we come from query ZG1_TEST1 we want to use selection sel1
    Query name  |  selection
    ZG1_TEST1   |  sel1
    ZG1_TEST2   |  sel2  
    How can we find out the query name in the customer exit for variables?
    Thanks for your help,
    Evi

    Hi Evi,
    check out the structure I_S_RKB1D in your exit. It contains the query.
    Siggi

  • How to find the class name, the location from where it invoked a method

    Hi,
    I have a class A. The caller calls A.someMethod(), whenever this method is invoked, I want to find out the caller info, which class invoked this method, from where this class was loaded (may be the jar file name). Any help will be appreciated.
    Thanks.

    However since version 1.4 there is an easier way to extract that information from the Throwable:
    java.lang.Throwable
    public StackTraceElement[] getStackTrace()
    Provides programmatic access to the stack trace information printed by printStackTrace(). Returns an array of stack trace elements, each representing one stack frame.

  • How to find out database name

    Hi
    can anyone please tell me how i can find out the database name for oracle8i.
    thankyou very much in advance

    I'm not expert in this, but your error has TNS in it which could mean its looking for the tnsnames.ora file which in an oracle client installation contains the mappings from the database name to the server ipaddress and port number for connection to oracle. Its possible you may need an oracle client installation.
    Another way of connecting is via ODBC drivers which are configured in control panel in winnt and under computer managenent in win2000. An installation of Oracle will ususally install ODBC drivers.

  • How to find out the names which have overlapping times

    Hello:
    I've a table which contains some names and their calling time period. I need to find out which of those names have overlapping time period.
    Name|StartTime|EndTime
    A|26/3/2011 12:33:16 PM|26/3/2011 12:40:10 PM
    A|26/3/2011 12:41:28 PM|26/3/2011 12:43:19 PM
    A|26/3/2011 12:42:28 PM|26/3/2011 12:47:50 PM
    B|26/3/2011 10:22:28 PM|26/3/2011 10:50:10 PM
    B|26/3/2011 10:49:28 PM|26/3/2011 10:53:50 PM
    B|26/3/2011 10:50:28 PM|26/3/2011 10:59:50 PM
    B|26/3/2011 10:59:58 PM|26/3/2011 11:10:50 PM
    C|26/3/2011 11:05:58 PM|26/3/2011 11:10:50 PM
    C|26/3/2011 11:40:58 PM|26/3/2011 11:50:50 PM
    I need those names which have multiple calls and one call starts before the end of another call. If anyone have four calls and two of those overlapped (A has two overlapping and B has three overlapping), that name should also come into my list like below:
    Name|Overlapping_Count
    A|1
    B|2
    Can anyone help me please?
    Thanks/Razin

    Thans for pointing out the error in my post. It seems, being rather busy in this period, I'm starting to wear out as I missed the fact the overlaps would be returned twice. :(
    I had in mind a more general case where as single row overlaps with more than one other row.
    The OP's data contained one to one overlaps only and it seems no generalized approach was needed.
    with
    the_data as
    (select 'A' name,to_date('26/03/2011 12:33:16','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:40:10','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'A' name,to_date('26/03/2011 12:41:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:43:19','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'A' name,to_date('26/03/2011 12:42:20','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:42:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'A' name,to_date('26/03/2011 12:42:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:47:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'B' name,to_date('26/03/2011 10:22:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:50:10','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'B' name,to_date('26/03/2011 10:49:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:53:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'B' name,to_date('26/03/2011 10:50:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:59:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'B' name,to_date('26/03/2011 10:59:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:10:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'C' name,to_date('26/03/2011 11:05:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:10:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'C' name,to_date('26/03/2011 11:40:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:50:50','dd/mm/yyyy hh24:mi:ss') end_time from dual
    select name,count(distinct overlap) overlapping_count
      from (select x.name,to_char(greatest(x.start_time,y.start_time),'yyyymmddhh24miss')||'|'||to_char(least(x.end_time,y.end_time),'yyyymmddhh24miss') overlap
              from the_data x,the_data y
             where x.name = y.name
               and greatest(x.start_time,y.start_time) < least(x.end_time,y.end_time)
               and x.start_time != y.start_time
               and x.end_time != y.end_time
    group by name
    order by name
    with
    the_data as
    (select 'A' name,to_date('26/03/2011 12:33:16','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:40:10','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'A' name,to_date('26/03/2011 12:41:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:43:19','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'A' name,to_date('26/03/2011 12:42:20','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:42:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'A' name,to_date('26/03/2011 12:42:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:47:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'B' name,to_date('26/03/2011 10:22:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:50:10','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'B' name,to_date('26/03/2011 10:49:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:53:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'B' name,to_date('26/03/2011 10:50:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:59:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'B' name,to_date('26/03/2011 10:59:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:10:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'C' name,to_date('26/03/2011 11:05:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:10:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
    select 'C' name,to_date('26/03/2011 11:40:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:50:50','dd/mm/yyyy hh24:mi:ss') end_time from dual
    t as
    (select name,
            case when max(end_time) over(partition by name order by start_time,end_time rows between unbounded preceding and 1 preceding) > start_time
                 then 0
                 else 1
            end start_of_group
      from  the_data
    select  name,
            count(*) overlapping_count
      from  t
    where start_of_group = 0
    group by name
    order by nameRegards
    Etbin

  • How to find out the name of the executable

    hi,
    say, i have an executable jar called Hello.jar. how do i know the name "Hello.jar" in main() when the executable jar is launched.
    that is, if i rename Hello.jar to HelloWorld.jar, how can main() know about this? this matters because i want to run the app
    in a separate process, which requires the name of the application.
    thanks

    yes to question 1: because i'm calling into a dll through jni to display a screensaver in the preview window. not spawning a separate process causes windows to hang for a while before
    the screensaver is displayed. the new process is passed arguments that are checked by main() so that another process won't be created (no infinite recursions).
    thanks.

  • How to  find out  Query name if i have Program generated by Query

    Hi Gurus,
    Can you please let me know the Query Name if i have the Program name.
    The program name is : AQTQP2P=========INVENTORY_SUM=
    I thought P2P is the user group and either "INVENTORY_SUM"  or  "AQTQP2P"  is the
    Query name but both doesn't exists in the system.
    Is there any way to get the correct Query name and User Group from the Program name.
    I have an FM : RSAQ_DECODE_REPORT_NAME  to get Query name and User group name
    but the reults given by them are P2P as user group and  "INVENTORY_SUM"  as Query name.
    I did not find any one of them in SQ01.
    Can you please help me out.
    Thanks,
    Vinay.

    Hi ,
    Thank for the information.
    In have both the Function modules.
    1. To get Query name from report name
    2. To get Report name from Query name
    I did all that stuff, still i did not find the User group or alteast some where near to it..
    there is no User Group that starts with letter P.
    But The report name is there
    i could execute it in both foreground and in background and able to get the Output as well.
    May be it is deleted from Development system.
    I do not have auth in QA and in PRD to check it.
    Can you please let me know
    By any chance the Query can get deleted and the corresponding program exists for that Query and
    we can work with the report even if the Query is deleted.
    Any ways i am goind to give you points (Vinod/Atish) for your help.
    Thanks,
    Vinay,

Maybe you are looking for

  • Anonymous user Unbale to access an WebDynpro ABAP iView

    Hi, I have developed an application using webdynpro ABAP and integrated that into portal. For this webdynpro application i have to create an iview, assigned it to a page, assigned this page to a custom role. I also set Authentication to anonymous for

  • Video test failed in graphic card laptop g50-70

    when i run hardware scan in lenovo solution center, i got waring graphic card video test and got result  Result code: WVC003000-DK7X2I Video Card. so i want to know why test show warning in my graphic card

  • HP Mini 210-1076

    I have the Broadband 5G 59.95 plan and have had it for quite sometime now, I need to cut back and my contract isn't up til 12/2012. I tried to downgrade to a cheaper plan but when I tried the website said that I would have to upgrade to the IPAD. I d

  • Does iBooks support JAVASCRIPT in ePub2/ePub3?

    Hi, I know that "iBooks" provides limited support of JAVASCRIPT in ePub format files (As per the document "iBookstoreAssetGuide4_8.pdf" page 27,28,etc.). My question is as follows: I have created a sample ePub with the following functionality: By def

  • Using legacy DLLs on a Linux system

    We are converting some of our apps to a Linux platform. The problem is some of our vendors furnish their SDKs only in Windows DLLs. Does anyone know of a method to communicate between the Linux app and the Windows DLL on the same Linux box. Michael