Why my vector() always always return the last record?

Whenever i uses Vector, my whole vector always return the last element.. why?? Anyway to solve this?
some examples of my codes..
(String)rowVector.elementAt(2)
My rowVector vector always return the last element..
while(rs1.next())
Vector rowVector = new Vector();
for (int currentCol = 0; currentCol < numCols; currentCol++)
rowVector.add(rs1.getString (currentCol + 1));
tableData.addElement(rowVector);

That means that every element in the Vector refers to the same object. I am surprised that your JDBC driver does not return different string objects for each call, but to work around that, try this:
rowVector.add(new String(rs1.getString (currentCol + 1)));

Similar Messages

  • Why do applications always open the last document or page viewed?

    I love my Mac.  But since I got my new iMac and OS Lion, I've had a hard time with one option and I can't figure out how to turn it off.
    When I open Excel, it opens the last document viewed.  Even when I click on a new document, it still opens the last document.  When I open Safari, it takes me to the last page viewed.  Its very annoying, probably useful to someone other then me. How do I turn this feature off?
    Thanks
    Jim

    That is part of Resume, a feature that re-opens the documents that were open when you quit.
    You can turn it off system-wide in the General System Preferences.
    On a per-app basis, you can only use the cmd-option-q shortcut or menu to close all windows and quit.

  • Why does Safari 5.1/Lion 5.7 always open the last Web sites  when you open Safari?

    Why does Safari 5.1/Lion 5.7 always open the last Web sites  when you open Safari?
    MacBook Pro 2.33 GHz intel core2 Duo

    Welcome to the iOS world of nonthinking, wherein the OS decides everything for you, whether or not that's what you want. Salient details described in http://www.apple.com/macosx/whats-new/features.html#resume
    See one of these to disable it:
    http://hints.macworld.com/article.php?story=20110918051930924
    http://osxdaily.com/2011/08/01/turn-off-resume-per-app-in-mac-os-x-lion/
    http://restoremenot.info/

  • Why do i always get the Japanese version of JRE/JDK?

    why do i always get the Japanese version?
    i am in tokyo and i just want to get the English version of JRE and JDK. Why is it so difficult, I have been trying for the last 8 hours to find mirrors and other versions and installing all of them only to see they are all in Japanese and I don't know why. I checked my settings, my local language is German or English, i.e. not Japanese, and always I install it it's in Japanese and afterwards I get the compiler messages in Japanese and I don't understand them.
    And then... why is it so difficult to make a comment at sun? i have been to ibm's page and google, you just fill out a form send it, it takes 5 secs, here it takes 20 minutes to find where you can ask a question, then some more to fill out the questionaire...
    could you pls tell me where to get the US/english version for jre 1.4.2.x and jdk 1.4.2.x?

    You probally ARE getting the english version. If you are using a japanese version of windows or an english version of windows with the locale setting set to Japan then all of the menus (including the installer) will be displayed in japanese. So it just seems like you are installing a japanese version.
    To check your local in windows 2000 go to the control panel and then choose regional options. Then, select the general tab and change your locale to one of the English locales. Also, if you want to keep your locale setting set to Japan there are other workarounds. However, first try this.

  • How come when I open Safari it does not open to my set homepage it always opens the last page I was on

    how come when I open Safari it does not open to my set homepage it always opens the last page I was on

    Check Safari/Preferences/General/Safari opens with -try setting it to new window.

  • When I start Safari 5.1 in Lion, it always opens the last page opened.  Is there a way to start on the homepage?

    When I start Safari 5.1 in Lion, it always opens the last page opened.  Is there a way to start on the homepage?

    That sounds great, but on my system, that box is not at the bottom of my Pref/General page, but is when I log out and put it to sleep.  What is really annoying is that I have to do this every time, instead of unchecking it and it being permanent.  Yes, I have Safari 5.1 and Lion.  I would like to permanently disable this as I too, think it is absurd and not a great idea when banking, paying bills, etc.

  • HT4859 What do I do every time I tap "Back up Now" (through iCloud) it always says "The last backup could not be complete". My iPad is plugged in, locked and connected to wi-fi.  I still have available 11GB storage from 15GB total storage from iCloud.

    What do I do every time I tap "Back up Now" (through iCloud) it always says "The last backup could not be completed". My iPad is plugged in, locked and connected to wi-fi.  I still have available 11GB storage from 15GB total storage from iCloud.

    I'm having exactly the same problem. I have a new iPad, my iCloud account is set up and verified (I wouldn't be logged in and writing this otherwise), auto backups are turned on, but it's never completed a backup. If I manually select 'Backup Now' in iCloud Settings, it times out while estimating time remaining. Strangely, today my iCloud free storage space went from 5G to 4.9G then back to 5G. Annoyingly, I'm now getting reminders that I've never backed it up! The iCloud help I followed from the forum didn't cover this error message.

  • GUID generation issue, SYSUUID always returns the same value.

    Hi,
    I'm using "SELECT SYSUUID FROM DUMMY" to get a guid value but it always return the same value.
    What should I do to get a unique value each time I execute the query above.
    Thanks.

    I thought I had the same problem and I found that if you generate multiple UUID's in the same SQL, it they will be the same.  If you make multiple calls, you should get multiple UUID's. 
    Try this:
    SELECT SYSUUID as UUID1 FROM DUMMY;
    SELECT SYSUUID as UUID2 FROM DUMMY;
    I get the following results:
    UUID1 = 538632FD7EA20426E10000000A3F10A9
    UUID2 = 538632FE7EA20426E10000000A3F10A9
    Notice that the strings look almost identical, but the 8th character on UUID1 is a D and the 8th on UUID2 is a E.
    Jim

  • Simple Query Question - How do I return the Last 3 records of a Table?

    Question.
    For example, I have a table that has 50 records.
    How do I, specify in SQL to only return the last 3 records of the table.
    Select a.* from table a where ????

    I was just trying to show an example to a friend on
    how something like this would work and if it was even possible. But it won't work. Here's a simple example:
    SQL> create table emp
      2  (id)
      3  as
      4  select object_id
      5  from   all_objects
      6  order  by object_id;
    Table created.
    SQL> select *
      2  from  (select rownum rn
      3               ,b.*
      4         from   emp b)
      5  where  rn > ( select (max(rownum) - 3)
      6                from    emp)
      7  ;
            RN         ID
         40830      55891
         40831      55892
         40832      55893So far, so good. These are the "last 3" rows inserted. Now delete a bunch of rows and insert 3 new ones:
    SQL> delete emp where id < 40000;
    33423 rows deleted.
    SQL> commit;
    Commit complete.
    SQL> insert into emp values (60000);
    1 row created.
    SQL> insert into emp values (60001);
    1 row created.
    SQL> insert into emp values (60002);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select *
      2  from  (select rownum rn
      3               ,b.*
      4         from   emp b)
      5  where  rn > ( select (max(rownum) - 3)
      6                from    emp)
      7  ;
            RN         ID
          7410      55891
          7411      55892
          7412      55893Here's the problem. Even though the "last 3 rows" are 60000 - 60002, I still get the same ones as the first query.

  • Need a FM which returns the last modified date& time

    Hi,
    Kindly Suggest me if any Function Module is there which returns the last modified date& time for tables HRP1000 and HRP1001.
    Rgds
    Kishor.C

    just check the following tables..
    CDHDR - Change document header
    CDPOS - Change document items
    you can use this function module..
    BPCT_CHANGEDOCUMENT_DISPLAY
    Edited by: Arunima Rudra on Apr 14, 2009 4:49 PM

  • How show the last record by date

    Hi Gurus,
    i got in the cube the next records for example:
    calday                  Material    Quantity
    01.01.2011             A                 10
    15.01.2011             A                  20
    if i present in the query these IO an KF the query will show these 2 records, now i want just show the last record by date
    calday                  Material    Quantity
    15.01.2011             A                  20
    i tried in the query with a calculate KF with exception aggregation , MAX with Reference to calday , but this still show both records... how can i do it? help gurus.

    Hello,
    If there are sales occuring for the material on two different dates and you include date in there will be always two records.
    I dont understand the need to show the last transaction. Anyways if you still need that you need to remodel the backend.
    Put a DSO on the cube with date in the data field, this will always overwrite the value for the key combination you need.
    Then you can return on this DSO.
    Regards
    Shashank

  • How to get the last record??

    Hi, I now have to get only the last record from one table
    from MS Access.
    I was looking for the useful method from API, however,
    I cannot get it.
    How to get only the last record from one table ???
    Please help, thanks.

    In RDBMS, row order is really not relavent by iteself. Meaning there is no such thing as 'last record' unless it's in the context of a column (e.g. timeStamp).
    Of course, rows are inserted and stored in some natural order, but you cannot assume they'll come back the same way in a 'Select *' as they were entered.
    So, if you mean last row as in last inserted row, I would add a timestamp field that's set at insert, or use a autonumber column. Either way, have a column that will always contain the highest number or newest timestamp, and then you can build your where clause from that.
    For instance, in Access, I have an autonumbered field called 'fred', with other columns. If I want the last record, I simply use the following:
    select * from atable where fred in (SELECT max(fred) AS Max FROM atable);
    the 'where in' clause will filter to only those records in the subsequent select statment, which of course is only one, the max of the column fred.
    bRi

  • Getting the last record from the internal table

    When we use a READ statement it always picks up the first record which fulfill its condition but in my case I want to pick up the last record that fulfills it condition
    I have a internal table like
    id     type
    N1      A
    N1      T
    N1      A
    N1      6 ----> LAST RECORD
    my code is
    read table itab wIth key id = netobjid.
    for eg if netobjid = N1 , then I want to read the last record that corresponds to N1 ie ID N1 TYPE - 6...
    How to do that?

    HI
    actually i have done same requirement like this ...
    Take  one count variable into your internal table ..you pass the number of records into cont variable for every time  u enter the loop .
    Sort the internal table with count variable descending . ( AS we cant sort the internal table with sy-tabix)
    Then use read statement with sy-index = 1 .
    USe below logic ,............
    data  :  count  type i value '0'.
    LOOP at int .
    count = count + 1 .
    endloop.
    sort int count descending .
    read int  with  index = 1 .

  • Function in select statement need to be called only for the last record.

    Select state,
    local,
    fun_state_loc_other_details(19) details
    from state_local
    where pm_key=19
    resuts:_
    State Local Details
    AP APlocal details1
    UP UPLocal details1
    MP MPLocal details1
    i) The above query returns 100 records
    ii) fun_state_loc_other_details is also getting called 100 times. But I want this function to be called only for the last record that is 100th record.
    is there any way to do that?

    Thanks amatu.
    One more small query. Can I do it on condition based.
    Select state,
    local,
    fun_state_loc_other_details(19) details
    from state_local
    where pm_key=19
    Like if one state it need to be called once.
    AP -- 50 records
    UP - 20 records
    MP -- 10 records.
    fyi: this record no. varies
    I want the function to be called for AP once, UP once, MP once.

  • Need to fetch the last record/row from a table

    Hi,
    I have a requirement like fetching the closing balance of the last record of the table and inserting the same into the opening balance of the immediatetly created next record.
    In simple words, I need to fetch a value from the last row of the record.
    For example, I use the below query,
    select rownum, empno, ename from emp
    where rownum = (select count(rownum) from emp);
    But, the above query does not return any of the record.
    Hence, need help on this.
    Regards,
    Shivakumar A
    Edited by: shiva on Mar 27, 2011 10:14 PM

    Rows in a table are inherently unordered. In order to introduce the concept of "first" and "last", you would need to specify how to order the rows which would require that there was one or more columns in the table that you could order by in order to determine the "last" record.
    In your closing balance example, if we assume that there is something like a BALANCE_DATE column,
    SELECT account_number, balance_amount, balance_date
      FROM (
        SELECT account_number,
               balance_amount,
               balance_date,
               rank() over (partition by account_number order by balance_date desc) rnk
          FROM table_of_balances )
    WHERE rnk = 1Justin

Maybe you are looking for

  • Can't get Office Add-in to allow drill in Excel.

    In 11.1.1.3, I have an Analysis pivottable that I can insert into Excel via the OBIEE Office Add-in. However, you can't use hierarchical columns with the add-in, only attribute columns. Nonetheless, attribute columns like "Per Year Name" are drillabl

  • Ipod contacts sync problem

    When the first time I sync my outlook express contacts to my ipod, there is no problem. After I added some contacts and try to sync, update to my ipod, I found that it add the whole contact again plus the new one and also some contacts ( in outlook e

  • Maxify MB5320 How do I make a duplex document flippable ( reverse side upside down)

    I have a 40 page docuiment, in landscape mode, that I duplex. The doc. will be placed in a binder and when the reader reads it he/she will flip the pages top to bottom. I wish to print the reverse side of each page  upside-down so the reader will not

  • Change of Material Type via MMAM

    Hi All, May I ask what are the other prerequisites in changing the Material type? What I know is stocks must be zeroed out, Open POs must be closed (is it the open POs only? or all POs with the specified material?) ,and OLD and NEW Material type shou

  • Using Parallels w/Macbook Pro

    I was using Windows on Parallels and wanted to save a file on my USB drive but it wouldn't read it at all. I am unable to open files from my USB drive in Windows also. If anyone has a solution to this please let me know...Something is blocking the US