Results 1 to 5 of 5
  1. #1
    A.M.S is offline Member
    Join Date
    Dec 2008
    Posts
    17
    Rep Power
    0

    Default How to insert a Value into a stored array ?

    Hi ,

    I'd like to ask, how may I insert || add value into a stored array(int) ?
    and how may I make the stored array size bigger than its original size ?

    thanks for help me :) ..

  2. #2
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    8

    Default arrays ve arraylists

    You can't change the size of an array. You can change the size of an arraylist.
    Array versus ArrayList
    Java Tutorials - ArrayList Vs. Static Arrays | DreamInCode.net
    Array (Java Platform SE 6)
    ArrayList (Java Platform SE 6)
    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  3. #3
    Jasonre is offline Member
    Join Date
    Jan 2009
    Posts
    40
    Rep Power
    0

    Default

    So to answer this another way, move the values of the array into an arraylist then add to the arraylist then move the values to a new array with the size of that array being arraylist.size()

  4. #4
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    8

    Default huh?

    I didn't quite understand that, but it didn't sound right... no need to move anything aywhere. Just use an arraylist from the begining. I've posted the link of the Javadoc so the methods to get (hint, hint) the elements from the arraylist can be studied.

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  5. #5
    Jasonre is offline Member
    Join Date
    Jan 2009
    Posts
    40
    Rep Power
    0

    Default

    yes, in a perfect world, i'd say use arrayList also :) gosh, sometimes i let where i work control my thoughts of how things are done... unfortunately i don't really have control of what comes in to the function and what leaves the function... so if a function's param is an array, then you need to insert into the array, and it returns an array... well i suppose you could just use arrayList.toArray() to send it back.. that to would work... anyhow, i think this rug has been beaten well :) user ArrayList!! :)

Similar Threads

  1. stored procedure
    By sankarigopi in forum JDBC
    Replies: 1
    Last Post: 11-13-2008, 05:53 PM
  2. Executing stored procedures
    By mew in forum JDBC
    Replies: 3
    Last Post: 08-20-2008, 06:47 PM
  3. Stored Procedures
    By geeta_ravikanti in forum JDBC
    Replies: 1
    Last Post: 04-22-2008, 03:34 AM
  4. How to access array stored in database through JSTL
    By saurabh.joshi in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 11-19-2007, 02:46 AM
  5. stored procedures in Hibernate
    By Alan in forum JDBC
    Replies: 2
    Last Post: 05-31-2007, 05:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •