I need to retrieve an Object[] of all keys in java.util.Hashtable

public abstract class ArrayFunctionality {
     * Construct {@link java.lang.Object} array of keys from {@link java.util.Hashtable}
     * @param h {@link java.util.Hashtable}
     * @return array {@link java.lang.String}
     * @throws java.lang.IndexOutOfBoundsException Exception thrown if initial {@link java.lang.Object} array paramater cannot be indexed
    public static Object[] arrayKeys(Hashtable<Object, Object> h) throws IndexOutOfBoundsException {
        Vector<Object> v = new Vector<Object>();
        Enumeration keys = h.keys();
        while (keys.hasMoreElements()) v.add(keys.nextElement());
        return v.toArray();
// HOWEVER, this occurs with Hashtable<String, String> attrs:
if (hasSetHashtable) String[] keyArray = ArrayFunctionality.arrayKeys(attrs);
// DOES NOT COMPILE: ".class expected - not a statement"I am not understanding why this is occurring, please advise, I'm lost on this one.
Thanx
Phil

I still don't understand what you mean but it now
works..
I am sorry I just don't understand the difference
between
if (hasSetHashtable) {
String[] keyArray;
keyArray = ArrayFunctionality.arrayKeys(attrs);
}AND
if (hasSetHashtable) {
String[] keyArray =
ArrayFunctionality.arrayKeys(attrs);PhilThere is no difference between those two you posted. The difference is between
String[] keyArray;
if (...) {
    keyArray = ArrayFunctionality.arrayKeys(attrs);
}and
if (...) {
     String[] keyArray;
     keyArray = ArrayFunctionality.arrayKeys(attrs);
}In the first, the keyArray will exist outside of the scope of the if statement. In the second, the keyArray will no longer exist once you leave the if statement. Which is the same thing jbish said.

Similar Messages

  • Error: Unsupported Object java.util.Hashtable

    Hi,
    I am getting Uncategorized SQL exception for my code:
    The error is:
    org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [select distinct table_desc from TABLE order by table_desc where   month = ?  and year = ? ]; SQL state [HY000]; error code [857]; [NCR][Teradata JDBC Driver]:PreparedStatement.setObject: Unsupported Object java.util.Hashtable ; nested exception is java.sql.SQLException: [NCR][Teradata JDBC Driver]:PreparedStatement.setObject: Unsupported Object java.util.Hashtable
    Here is the code
    public class ABC {  
    private static final String MYDATE = "  month = ?  and year = ? ";
    public List<String> getTables(Report report) {
              List<String> tables =  new ArrayList<String>();
              JdbcTemplate template = new JdbcTemplate( dataSource );          
              Object sqlParameters[] = null;
              sqlParameters = new Object[]{ getMonthAndYear( report ) };
              String sql = "select distinct table_description from TABLE " +
              " order by table_description where ";
              tables= template.queryForList(sql + MYDATE,sqlParameters);          //the error is throwing on this line     
              return( tables);
    private Map<Integer, Integer> getMonthAndYear( Report report ) {
          Calendar today = Calendar.getInstance();
          Map<Integer, Integer> monthYear = new Hashtable<Integer, Integer>();     
          monthYear.put( Calendar.MONTH, today.get( Calendar.MONTH ) );
          monthYear.put( Calendar.YEAR, today.get( Calendar.YEAR ) );        
            System.out.println("monthYear :"+monthYear);//this prints monthYear :{2=10, 1=2008}
            return( monthYear );
    }Can anybody help me solve it? It's something to do with the parameters I am getting back...
    I will appreciate your help,
    Thanks in advance...

    evnafets wrote:
    What do you expect it to do with your "parameters"?
    You are using a [Spring JdbcTemplate|http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/jdbc/core/JdbcTemplate.html#queryForList(java.lang.String,%20java.lang.Object[])]
    What should the where clause of your sql query be?
    Why do you think this would accept parameters in a Map<Integer, Integer> ?The parameters would restrict the result I will get with my query, i have to bound with month and year constraint as part of requirements.
    The Where clause would be : where month = ? and year = ? ( which could be month = 10 and year = 2008)
    I am using Map<Integer, Integer> because in database these month and year values are numeric...
    But I don't know what it doesn't like it?
    Any idea?
    Edited by: ASH_2007 on Nov 11, 2008 1:36 PM

  • I need help retrieveing cs3 design standard product key

    I purchased 2 adobe cs3 design standard in 2008. The purchase was made from new egg. I have a copy of the invoice. Need to get the product key. Can you help?

    We can't help you. This is a user forum and we can't help with product key/ registration numbers/ etc.
    You need to use Adobe Chat to talk to an Adobe rep:
    Contact Customer Care

  • I moved 2 weeks ago and my computer never started again. I need to retrieve all my adobe products, and there is a long list of them. What do I do first?

    System crashed. Need to retrieve all my Adobe products. What do I do?

    Berlene8000 please contact our support team to locate your account and serial numbers.  For the best assistance, I recommend our chat support at http://adobe.ly/yxj0t6.  Our chat representatives can provide a personalized experience to resolve the issue you have described.

  • Retrieve permision levels for all items in list programatically

    Hi all,
    I need to retrieve all permission levels for all items in a list programatically using client object model in sharepoint 2010.Please send me the code sample.
    Regards,
    Praveen

    Hi Praveen,
    This blog has the code that you are looking for -
    http://www.learningsharepoint.com/2010/07/27/programatically-get-permissions-for-list-and-item-client-object-model-sharepoint-2010/
    or this forum for an idea -
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/6b16b407-203b-4c5b-9605-713904e9b22e/sharepoint-2010-how-to-get-a-list-of-permissions-for-each-individual-user?forum=sharepointadminprevious
    Hope this helps!
    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/

  • Retrieve multiple objects with MVC/FrontController for view in JSP.

    I have made a MVC system (front-end only); a link call the url: ?page=createSomething to the FrontController, that is implemented as a Servlet, and then dispatch to createSomething.jsp. That�s all fine, but I need to retrieve 2-3 list to use in dropdowns, and that�s here I give up!
    A simple scenario is to retrieve a single object eg a member: I call the url: ?page=viewmemeber&command=viewMemeber&id=5. The Servlet call a commandHandler witch return a member, use setAttribute(�member�, member); and then dispatch to viewmember.jsp and use JSTL to view the member. That�s all fine, as long I only need to set a single object or a list of objects.
    The problem is now I want to create a member and need to retrieve 2-3 list to use in a dropdown when creating a member.. I can do a ?page=createmember&command=getAllCountries, but that will only allow a dropdown of countries.
    Is the solution to use a command pattern and use: ?page=createmember&command=getAllCountrysAndCitysAnd� ?
    My servlet
    commandhandlerclass = Class.forName("controllers.CommandHandler");
                    commandhandlerobject = commandhandlerclass.newInstance();
                    Object arguments[] = new Object[] { requestContextMap };
                    commandhandlermethod = commandhandlerclass.getMethod(
                        getString(requestContextMap, "command"),
                        new Class[] { requestContextMap.getClass() }
                    commandhandlerreturndata = commandhandlermethod.invoke(commandhandlerobject, arguments);
    request.setAttribute("bean", commandhandlerreturndata);

    Hi Dear,
    I think you want to create a member and in create member page you want two to three combo box.
    If my understanding is right then you can create a wrapper method that get all required data like city,state,countries and return all that data as map or collection. After getting all that required data set it to request or whereever you like and forward request to the JSP page. Then in JSP page you can get all that data from the map (Country data, city data ...).
    If you required help, i am ready for the same...
    Regard
    Patel Vinod

  • Help needed in Identifying dependent objects

    Hi all,
    Basically I need to identify the object related to Integration which is not there in one of our software product under development as compare to other(existing) already developed so that we can apply them in the product being developed.
    I need to find these below from few of the packages given to me
    &#61550;     dependent packages/functions to read and update data
    1)     Tables
    2)     Packages
    3)     Triggers
    4)     Views
    5) Jobs
    I would request you to help me in carrying out this faster, I have plsql Developer tool, how to start with so that i m not mess up with and complete it faster.
    Regards,
    Asif.

    Thankx Pierre Forstmann.
    Dear All,
    Can any one help me in identifying all dependent objects for one object.
    Will this works for me I found from the above link provided,
    as for the time being I do not have the dba priviliges...
    If I am able to get the dba prviliges will this code works for me to get the
    required information....
    Regards,
    AAK.
    SQL>
    create or replace type myScalarType as object
    ( lvl number,
    rname varchar2(30),
    rowner varchar2(30),
    rtype varchar2(30)
    Type created.
    SQL> create or replace type myTableType as table of
    myScalarType
    Type created.
    SQL>
    SQL> create or replace
    function depends( p_name in varchar2,
    p_type in varchar2,
    p_owner in varchar2 default USER,
    p_lvl in number default 1 ) return myTableType
    AUTHID CURRENT_USER
    as
    l_data myTableType := myTableType();
    procedure recurse( p_name in varchar2,
    p_type in varchar2,
    p_owner in varchar2,
    p_lvl in number )
    is
    begin
    if ( l_data.count > 1000 )
    then
    raise_application_error( -20001, 'probable connect by loop,
    aborting' );
    end if;
    for x in ( select /*+ first_rows */ referenced_name,
    referenced_owner,
    referenced_type
    from dba_dependencies
    where owner = p_owner
    and type = p_type
    and name = p_name )
    loop
    l_data.extend;
    l_data(l_data.count) :=
    myScalarType( p_lvl, x.referenced_name,
    x.referenced_owner, x.referenced_type );
    recurse( x.referenced_name, x.referenced_type,
    x.referenced_owner, p_lvl+1);
    end loop;
    end;
    begin
    l_data.extend;
    l_data(l_data.count) := myScalarType( 1, p_name, p_owner, p_type );
    recurse( p_name, p_type, p_owner, 2 );
    return l_data;
    end;
    Function created.
    SQL>
    SQL> set timing on
    SQL>
    SQL> select * from table(
    cast(depends('DBA_VIEWS','VIEW','SYS') as myTableType ) );
    ---select * from table(cast('USER_VIEWS') as myTableType ) );
    LVL     RNAME          ROWNER          RTYPE
    1     DBA_VIEWS     SYS               VIEW
    2     TYPED_VIEW$ SYS               TABLE
    2     USER$          SYS               TABLE
    2     VIEW$          SYS               TABLE
    2     OBJ$          SYS               TABLE
    2     SUPEROBJ$ SYS               TABLE
    2     STANDARD SYS               PACKAGE
    7 rows selected.
    Elapsed: 00:00:00.42
    SQL>
    SQL>
    SQL> drop table t;
    Table dropped.
    Elapsed: 00:00:00.13
    SQL> create table t ( x int );
    Table created.
    Elapsed: 00:00:00.03
    SQL> create or replace view v1 as select * from t;
    View created.
    Elapsed: 00:00:00.06
    SQL> create or replace view v2 as select t.x xx, v1.x yy from
    v1, t;
    View created.
    Elapsed: 00:00:00.06
    SQL> create or replace view v3 as select v2.*, t.x xxx, v1.x
    yyy from v2, v1, t;
    View created.
    Elapsed: 00:00:00.07
    SQL>
    SQL>
    SQL> select lpad(' ',lvl*2,' ') || rowner || '.' || rname ||
    '(' || rtype || ')' hierarchy
    2 from table( cast(depends('V3','VIEW') as myTableType ) );
    HIERARCHY
    OPS$TKYTE.V3(VIEW)
    OPS$TKYTE.T(TABLE)
    OPS$TKYTE.V1(VIEW)
    OPS$TKYTE.T(TABLE)
    OPS$TKYTE.V2(VIEW)
    OPS$TKYTE.T(TABLE)
    OPS$TKYTE.V1(VIEW)
    OPS$TKYTE.T(TABLE)
    8 rows selected.
    Message was edited by:
    460425

  • Hi my iphone was stolen, and i need to retrieve my serial number, i dont have a box is it possible to get it through i tunes?

    hi my iphone was stolen, and i need to retrieve my serial number, i dont have a box is it possible to get it through i tunes?

    well my laptop was formatted and all data along as well, so is there any other way as i only have my login with purchased items on Itunes. Would apple be able t help me out?

  • I need to retrieve files from my iPad but I forgot my password. I tried to restore it but then it said I had to turn off Find my iPad on my iPad. I can't do this because I can't get into it. What do I do?

    I need to retrieve files from my iPad but I forgot my password. I tried to restore it but then it said I had to turn off Find my iPad on my iPad. I can't do this because I can't get into it. What do I do?

    If the iPad was running iOS 7,  iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • Need help for finding objects impacted by size change for an infoobject

    hi all,
    need help for finding objects impacted by size change
    for xxx infoobject, due to some requirements, the size to be changed from
    char(4) to char(10), in the source database tables as well as adjustment
    to be done in BI side.
    this infoobject xxx is nav attribute of YYY as well as for WWW
    infoobjects. and xxx is loaded from infopkg for www infoobject load.
    now that i have to prepare an impact analysis doc for BI side.
    pls help me with what all could be impacted and what to be done as a
    solution to implement the size change.
    FYI:
    where used list for xxx infoobject - relveals these object types :
    infocubes,
    infosources,
    tranfer rules,
    DSO.
    attribute of characteristic,
    nav attribute,
    ref infoobject,
    in queries,
    in variables

    Hi Swetha,
    You will have to manually make the table adjustments in all the systems using SE14 trans since the changes done using SE14 cannot be collected in any TR.
    How to adjust tables :
    Enter the table name in SE14. For ex for any Z master data(Say ZABCD), master data table name would be /BIC/PZABCD, text table would be /BIC/TZABCD. Similarly any DSO(say ZXYZ) table name would be /BIC/AZXYZ00 etc.
    Just enter the table name in SE14 trans --> Edit --> Select the radio button "Save Data" --> Click on Activate & adjust database table.
    NOTE : Be very careful in using SE14 trans since there is possibility that the backend table could be deleted.
    How to collect the changes in TR:
    You can collect only the changes made to the IO --> When you activate, it will ask you for the TR --> Enter the correct package name & create a new TR. If it doesn't prompt you for TR, just goto Extras --> Write transport request from the IO properties Menu screen. Once these IO changes are moved successfully, then the above proceduce can be followed using SE14 trans.
    Hope it helps!
    Regards,
    Pavan

  • How to create an object alive all the time on a server side

    Hi,
    I work on an Intranet with J2EE technologies. I need an object to do several tasks in background on the server side. Like start scheduled processes on a database and files, stocked on the server. What is the way to do this. I thought to use the JNDI by declaring the object in the Deployement Descriptor, and to manage a timer within.
    I don't know if this works.
    Anyway, my question is how to create an object on the server that is ALIVE ALL THE TIME and visible by the other objects running in the same VM.
    Thank's.

    This may not be the correct design, but I had success doing the following:
    1. Create an Stateless EJB that does a task, i.e. update a database table.
    2. Create a subclass of java.util.TimerTask to call the EJB methods.
    3. Kick off the TimerTask from a servlet.init method.
    Seems to work pretty well to do scheduled tasks, such as refreshing lookup tables. I would imagine the same could be done with an MBean, but I haven't had time to fully understand JMX yet. (It's on the list).
    As for event driven procedures, that can be done through a servlet interface.
    You may also wish to review a scheduler here: http://www.part.net/quartz.html. Note, I have NOT even looked at it yet, so I have no clue if it's any good. But, it is on my list of tools to evaluate (that's a long list) someday when my head's above water. Have a look, and caveat emptor.
    Hope this helps,
    Perry Tew

  • SQL function to retrieve records only if all the values are available.

    Hi,
    I have a sales table on which i run a parameterized query.
    We pass a few week IDs to retrieve store sales.
    I need to retrieve only those stores that has sales in all the week IDs passed.
    If i use the in operator, i am getting the store data even if there is sales for only one week.
    Is there a function in oracle to do this?
    Thanks,
    Sharan.

    Hi, Sharan,
    Here's how you could use the analytic COUNT function:
    WITH     got_week_cnt     AS
         select  week_id, store_id, prod_desc, sales_units_raw, sales_value_raw
         ,     COUNT (DISTINCT week_id) OVER (PARTITION BY  store_id)            AS week_cnt
         from     sales_store_dwh
         where      week_id in (&&Week_ID_CSV)
    select  week_id, store_id, prod_desc, sales_units_raw, sales_value_raw
    FROM     got_week_cnt
    WHERE     week_cnt  = 1 + LENGTH ('&&Week_ID_CSV')
                    - LENGTH (REPLACE ('&&Week_ID_CSV', ','))
    ;Notice that the sub-query got_week_cnt is just your original query, with the COUNT function added.
    You didn't post your tables or results, so I can't test it.
    You didn't say what version you're using, so I made a conservative guess (Oracle 9 or higher). In Oracle 11, there's a simpler way to find the number of weeks passed.

  • Need documents of ABAP Object Oriented concepts

    Hi,
    I  need materials on ABAP Object Oriented Concepts to learn.
    If you have any good documents which covers all the topics of ABAP OO then please send me to [email protected]
    Thanks in advance.
    Regards,
    Chandru

    Chandra,
    Very good sites with docs.
    http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    Pls. reward if useful...

  • Could not retrieve System Object  for the alias.

    Hi all,
    I have installed a business package (Maintenance Technician) and created system SAP_PM with aliases SAP_ECC_Manufacturing, and SAP_ECC_Common.  When I am logged into portal using Super Admin role, all the iviews of business package are working fine.  But when I am logged in using normal user, all iviews in the business packages are throwing the following exception.  Any ideas why? I appreciate your input.
    <b>Exception in SAP Application Integrator occured: Cannot retrieve system object for this alias. System Alias: 'SAP_ECC_Manufacturing', System ID: 'pcd:portal_content/com.xyz.fl_systems/com.xyz.SAP_PM'. User: 'abcuser',
    Reason: Access denied (Object(s): portal_content/com.xyz.fl_systems/com.xyz.SAP_PM).</b>
    Thanks
    Vicky R.

    Hi Vicky,
    can u pls share ur experience how did u solve this problem, i too facing the same problem.
    what i did  created one user who is already existed in BI System and created few iviews related to BI Reports.
    when i logged in through that user id in portal , while executing system is throughing the error what u have faced.
    Could u please let me know how did u solve that problem.
    Thanks in Advance
    RamanaRao V

  • Why do we need a disabled AD object prior to migrating user from one domain to another.

    Say i am migrating a user 'Mr.A' mailbox from abc.com to xyz.com in exchange 2010 environemnt, why do i need a disabled AD object for Mr. A in xyz.com prior to migrating  ? please suggest.
    Aditya Mediratta

    Hi ,
    To be frank i am not aware of quest but i can suggest you in ADMT and also in exchange cross forest migration.
    I hope you are doing the cross forest migration from exchange forest to exchange forest , so on such case by using the prepare-moverequest.ps1  we can have
    only have the disabled MEU on the target exchange forest until the remaining attributes of the user object was migrated from ADMT.
    While running the prepare-moverequest.ps1  it will not completely move all the active directory user attributes from the source forest to the target forest
    but it will move all the exchange attributes to the target forest and finally it will make the MEU object in the disabled state. Since
    all the exchange attributes are already migrated to the target forest ,so prior to use ADMT user account migration we need to exclude the exchange attributes
    by running the script on the ADMT server .After doing so exchange attributes will not be migrated but the required user attributes will be migrated to make the MEU to the enabled state.
    Reference Link for types of exchange migration between the forest :
    http://blogs.technet.com/b/exchange/archive/2010/08/10/3410619.aspx
    Thanks & Regards S.Nithyanandham

Maybe you are looking for

  • How do I change the Apple ID on my ipad? - Help please

    I forgot the password for my apple ID so have now obatined a new apple ID - how do I change the old apple ID to the new one on my ipad as it appears to be locked and keeps asking for the password for my old Apple ID. Thanks

  • A Simple Number Countdown

    Hello all. This is my first time posting on the Adobe Forums, but I can tell you, this community has been a huge help over the years! I finally found a problem that I couldn't find the answer to by searching online, and I hope someone with some more

  • Sys.dm_exec_query_stats

    In the DMV - sys.dm_exec_query_stats, I see in BOL: total_elapsed_time bigint Total elapsed time, reported in microseconds (but only accurate to milliseconds), for completed executions of this plan. last_elapsed_time bigint Elapsed time, reported in

  • Lightroom Photoshop Interface problem

    My Lightroom (LR) to Photoshop (PS) Picture interface used to work, but doesn't now.  Used to be, I'd click on the picture in LR, PS would open with the picture ready for edit.  Now LR opens PS without the picture.  I am using Windows 8.1 with PS CC

  • Print thru XSL or XML

    Hi all i am struggling to take the print in webdynpro SO for, i have tried the following code using your valuable help Pls Guide me futher more.Nobody giving correct solution so for i.e Step by Step from the beginning itself pls help us in this regar