Please Help! ?Result Set not updating correctly

Hi
This problem has been driving me mad for days now so if anyone can shed any light on it I?d be really grateful.
I have a jTable in a frame which is populated via a database. (NB I?m using Access 2000 and the JDBC-ODBC driver v.4.00.6019). Data is added to the table via a dialog box. i.e. when the submit button on the dialog box is clicked, the new data input into textfields and text areas in the dialog box is added to the database and then the database is requeried so that the data just added is also displayed in the table. The database is updated every time with no problems, I?m sure of this, however the jTable is not. Sometimes the jTable displays the updated data, other times it doesn?t. e.g. say I input ?a? via the dialog box, this value does not appear in the table. Then I input ?b? say, and ?a? will then be added to the table or sometimes ?a? and ?b? together. Sometimes the table is updated first time no problem, other times I have the scenario mentioned above.
I?ve looked at the result set that?s being returned when the database is requeried and it contains exactly the same data that appears in the jTable. So despite the fact that the database is definitely updated, I?m getting an incorrect result set. I?m using only the one connection object that?s created when the application is begun. I?ve even tried a dummy select statement before my proper requery of the database (as I?ve seen mentioned for a similar problem) but this doesn?t solve the problem.
I am ?refreshing? the jTable by way of a refresh method in the jTable?s Table Model.
The code is:
public void refresh ()
  rows.clear();
  firstColumn.clear();
  try {
   Statement statement = conn.createStatement();
   ResultSet rs = statement.executeQuery(query);
   ResultSetMetaData rsmd = rs.getMetaData();
   boolean moreRecords = rs.next();
     do
      rows.addElement( getNextRow (rs,rsmd));
     while (rs.next() );
     statement.close();
  catch ( SQLException sqlex )
    sqlex.printStackTrace();
  this.fireTableDataChanged();
}//End of Method  And the actual refresh method is being called when the dialog box is closed:
void jButton4_actionPerformed(ActionEvent e) {
    TimetableDialog tdBox = new TimetableDialog (this,"Enter Date and Event",true,dealName);
    setDialogBoxLocationCentre (tdBox);
    tdBox.setVisible(true);//Code below this not executed until Dialog disposed of
    boolean validData = tdBox.returnDataValid();
      timetableModel.refresh();
     Does anyone have any idea what might be going on? It is vital that I solve this. Thanks a lot for any help.
LGS

According to the documentation on the Connection class. New Connections are auto-commit by default, but the commit takes place irregularly.
"The commit occurs when the statement completes or the next execute occurs." This maybe where the ambiguity occurs. Maybe try forcing the commit connection.commit();

Similar Messages

  • Please help me set my Camera correct

    Hi
    What setting will give possibly result ?
    It might go for broad-casting (PAL 25fps)
    I'll use FinalCut (6) for editing.
    Camera to be set as:
    50i 24M(FX)
    50i 17M(FH)
    50p 28M(PS)
    25p 24M(FX)
    25p 17M(FH)
    Yours Bengt W

    interlaced and progressive (i and p) have different looks.  p is more film-like although there are many things that go in to creating a "film" look.  I'm assuming the 50 frame rates are for shooting slow motion.  50i may indicate 50 fields per second rather than 50 frames per second so that is probably just 25 interlaced frames per second.  What camera are you shooting with?  I think the M setting indicates the data rate so in general, the higher the data rate, the more info and better quality.  If I'm wrong on any of this, hopefully someone will speak up.  You might want to check the camera manual.  Manuals often explain the pros and cons of different shooting formats.  You may also have issues with different formats compatabilities with fcp6.  Testing is always a good idea. 

  • I have an IPhone operating OS 4.21. I cannot back it up before update and I cannot set up an ICloud account as it needs to be on a version later on the device. Please help, I want to update but not lose everything!

    I have an IPhone operating OS 4.21. I cannot back it up before update and I cannot set up an ICloud account as it needs to be on a version later on the device. Please help, I want to update but not lose everything!

    SorchaH wrote:
    I receive an error "Itunes cannot back up the IPhone because the back up cannot be saved on the computer".. So I tried to download and log into ICLoud but need to do this from my device..
    That would tend to indicate a permissions issues on the computer.
    Running an outdated version of iTunes is of absolutely no benefit.
    All iDevices work with the current version of iTunes.

  • HT1766 please help...we updated ipod2 4.1 to IOS 5.1 at itunes...after it was finished only the contacts were restored...not the music & videos...we found the backed up data in the pc(windows 7)after entering %appdata%..pls help how to restore..thanks!God

    please help...we updated ipod2 4.1 to IOS 5.1 at itunes...after it was finished only the contacts were restored...not the music & videos...iwe found the backed up data in the pc(windows 7)after entering %appdata%..pls help on how to restore...we will appreciate it very much....thanks! God bless!

    The iPod backup that iTunes makes does not include synced media like app, music and videos. Thus, you wll have to resync those back to your iPod.
    If necessary you can redownload iTunes purchases by:
      Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • I've a problem which is: Ibelieve there's someone who knows my password in some games like "Happy Day" so, could you please help me by not letting anybody to use this game except for this IMEI 01 336000 521261 1 even if they have the correct password.

    I've a problem which is: Ibelieve there's someone who knows my password in some games like "Happy Day" so, could you please help me by not letting anybody to use this game except for this IMEI 01 336000 521261 1 even if they have the correct password. Thanks alot for your help.

    Change your password.
    These are user forums. We can't do what you ask, in fact no one can.

  • I am facing wifi and mobile 2G signal issue after upgrading to IOS 6 from IOS 5 in IPhone 3GS. Please help, restoring setting even didn't helped.

    I am facing wifi and mobile 2G signal issue after upgrading to IOS 6 from IOS 5 in IPhone 3GS. The mobile carrier signal as well as WIFI suddenly drops zero and are then restored automatically. Sometimes i cannot conenct to WIFI even standing infront of WIFI router. Please help, restoring setting even didn't helped.

    Update: my phone's connecting to the WiFi again. I don't know what did the trick. I did nothing since reinstalling the software. It hadn't worked then, it is now. I tried connecting to my dad's phone's hotspot( he uses a Moto G), and it worked. I then tried connecting to the WiFi at a friend's house, and when I came back home, my phone was able to connect to my WiFi! Is it of any significance that my friend's router doesn't require a password? My issue has been resolved( for now; I hope I'm not counting my chickens before they've hatched). For anyone facing a similar issue, I suggest you try everything I did:
    1. Turn your router off for a minimum of 30 seconds, turn it back on and try connecting.
    2. Click on the WiFi network you are connected to, scroll to the bottom, tap "Renew Lease".
    3. Do a soft and hard reset.
    4. Reset network settings.
    5. Back your data up, erase all content from settings menu, restore from backup.
    6. Reinstall your software( put it in recovery mode).
    I am not sure which of the above worked for me. Make sure you try everything. If none of the above works, take it to a genius bar or an authorised service provider. Good luck! :)

  • [PWS0007] Operation result set not found.

    Hi,
    I am working with java,db2 on AS/400.
    When I am using my application with multiple users hitting the submit at the same time,I am getting
    the following error:
    Exception: [PWS0007] Operation result set not found. Cause . . . . . : The handle specified for the operation result set to be filled, returned, or used as the based on result set is not found for the server.
    Recovery . . . : Correct the operation result set handle and do the function again.
    Can anybody please tell me what could be the problem?
    Thanks in advance.

    problem could be
    1)Resulsets objects are not closing after getting data (like end of rRrsultSet while loop)
    2)it is better close statements and connection objects also.

  • Apple Mail read status does not update correctly

    I have one iMac running Mavericks and using Apple Mail to run three IMAP accounts provided by a local Apple Mountain Lion Server.
    It exhibits two issues:
    Firstly it fails to refresh the view automatically in the message viewer window.
    The header at the very top of the window will update live when a new message comes in so that it says "X Messages (Y Unread)" with the correct numbers. The list of messages does not update unless you switch mailboxes, then switch back again. Then they appear instantly.
    The second and more critical issue is that the read and unread status of messages is not updating correctly at all. Refreshing the view make no difference. Two of the three accounts are shared with 6 other iMacs running Mountain Lion and Snow Leopard. None of these have an issue.
    I have deleted and re-added the accounts several times, I have tried a completely clean new user account. Sometimes the first issue goes away but it returns after a short time.
    The next step would be to erase the whole Mac but I am reluctant to go to the hassle as I have a suspicion that this will not make a difference and that there is a glitch with Mail on Mavericks. I have run all updates.

    Hi Brenn,
    To narrow down the issue, we need more investigation:
    1.Does the issue occurs only in Category view? Please check if user 1 set the view to Date and email read status update.
    2.Does the issue occurs to user1's own mailbox with the same setting as shared mailbox?
    3.If the shared mailbox is in cached mode, please check Account Settings > Change > More Settings... > Adwanced > Use Cached Exchange mode > check Download shared folders.
    4.Please switch to online mode for shared mailbox and test the issue.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • I'm in trouble, my iPod Touch is giving 4th shock when recharge and the battery does not last any more. who knows or has a similar problem, please help me. Note: all this after I downloaded the new version OS5.

    I'm in trouble, my iPod Touch is giving 4th shock when recharge and the battery does not last any more. who knows or has a similar problem, please help me. Note: all this after I downloaded the new version OS5.

    I would make an appointment at the Genius Bar of an Apple store because of the shock issue. I doubt it was caused by the update.

  • Last night i have used my ipod and in morning i found it dead please help me its not responding at all i have tried evry thing

    last night i have used my ipod and in morning i found it dead please help me its not responding at all i have tried evry thing

    Charge the battery.
    If necessary, restore the iPod >  iTunes: Backing up, updating, and restoring your iPhone, iPad, or iPod touch software

  • Please help to set the time zone in a porper way

    Dear Folks please help to set the time zone in a porper way
    select sessiontimezone from dual;
    Database: Oracle 11.2.0.2
    Operating system: AIX 5.3
    SESSIONTIMEZONE
    +00:00
    SQL> select systimestamp from dual;
    SYSTIMESTAMP
    06-NOV-12 04.21.07.438426 AM +00:00
    SQL> select dbtimezone from dual;
    DBTIME
    +00:00
    SQL> Select DBMS_SCHEDULER.get_sys_time_zone_name from dual;
    GET_SYS_TIME_ZONE_NAME
    Asia/Kuala_Lumpur
    By looking Doc ID: Note:149120.1 in Metalink:
    ALTER DATABASE <my db name> SET TIME_ZONE = 'Asia/Kuala_Lumpur'
    or
    ALTER DATABASE <my db name> SET TIME_ZONE = '+08:00'
    For reflecting the change I refreshed the db by shutdown and restart.
    but still the returning no timezone value for user schema, please help how to set the time zone in a proper way?

    SQL> conn sys/sys as sysdba
    Connected.
    DBNAME
    db
    SQL> select u.name || '.' || o.name || '.' || c.name "Col TSLTZ"
      2    from sys.obj$ o, sys.col$ c, sys.user$ u
      3   where c.type# = 231
      4     and o.obj# = c.obj#
      5     and u.user# = o.owner#;
    no rows selected
    SQL>  select DBTIMEZONE from dual;
    DBTIME
    +00:00
    SQL> alter database set time_zone='Asia/Kuala_Lumpur';
    Database altered.
    SQL> select DBTIMEZONE from dual;
    DBTIME
    +00:00
    SQL> startup force;
    ORACLE instance started.
    Total System Global Area  426852352 bytes
    Fixed Size                  1375060 bytes
    Variable Size             260048044 bytes
    Database Buffers          159383552 bytes
    Redo Buffers                6045696 bytes
    Database mounted.
    Database opened.
    SQL> select DBTIMEZONE from dual;
    DBTIMEZONE
    Asia/Kuala_LumpurRefer:
    Re: how to check db time zone
    Edited by: Ora on 5 Nov, 2012 11:36 PM

  • Alter nate color applied in SSRS report is not updating correctly when you export to excel

    alternate color applied in SSRS report  is not updating correctly when you export to excel. Please let me know how can I resolve this issue
    Smash126

    Expression I am using report is
    =IIf(RowNumber(
    Nothing)
    Mod2 = 0,
    "Silver",
    Nothing)
    Smash126

  • ASP timeout value not updating correctly

    MS Server 2000
    MS SQL Server 2003
    Connection timeout not updating correctly.  In Enterprise Manager I updated from 600 to 900 seconds.  I had some connections issues and the solution said to modify the properties of the DB user to grant it 'write' privilege.  It solved the
    first issue but now it is timing out after 300 seconds.  After searching again I saw something about modifying the timeout for the user.  Could this be the solution and how do you do that.
    Classic ASP.  In the code I use:
    Server.CreateObject("ADODB.Command")
    Thank you in advance.

    Hello,
    You can try to using the CommandTimeout property to specify the number of seconds to wait while attempting to execute a command. For example:
    set comm=Server.CreateObject("ADODB.Command")
    comm.CommandTimeout=600
    Reference:http://www.w3schools.com/ado/prop_commandtimeout.asp
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Please Help ... Update iOS 6.1 Error !!!!

    Please Help ... Update iOS 6.1 Error !!!!
    Update iOS 6.1 via iTunes ... (Connect my iPod to my PC)
    Download iOS 6.1 Complete
    But Install Error
    Now my iPod Touch 5th is Dead !!!!
    iTunes can't see my iPod Touch 5th

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • I have a big problem :( why is it i cant update my ipod touch 2g into ios 4! im using the latest version of itunes and everytime i click "update" it stucks on the "contacting server" please help :( i want to update it now

    i have a big problem why is it i cant update my ipod touch 2g into ios 4! im using the latest version of itunes and everytime i click "update" it stucks on the "contacting server" please help i want to update it now

    Maybe here:
    iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server

Maybe you are looking for

  • Unable to pass the values from one report to another using navigation links

    Hi All, I am facing a strange issue where I have to pass a column value from one report to other. I have kept navigation link in the 1st report and 'is prompted' option in the 2nd report Issue was , I'm not getting the filtered result in the 2nd repo

  • Flex for Java Developer?

    I am working on flex 1.5 from last 7 months.Ealier i hv worked on Java (1.5 Yr) I hv created an application in flex sucessfully. My Qtn is: Whether i have to continue with flex or move to another technologies like Struts etc. Because i have nil knowl

  • ClassCastException on Deployment in Weblogic 10.3

    When I am deploying my application in Weblogic 10.3, I am getting below Exception. weblogic.application.ModuleException: com.ctc.wstx.stax.WstxInputFactory cannot be cast to javax.xml.stream.XMLInputFactory Earlier I had no problem with Weblogic 8.1.

  • Where should I direct new feature ideas for my Macbook Pro

    I have an idea that I would like to see incorporated into the tracking pad and would like to know who I should direct new ideas for development to?

  • No Closed Captioning support in QT 10.3?

    Hi, I'm on Mavericks with a 3 year old iMac. A friend sent me a closed-captioned Quicktime MOV file, which displays the CC text on his Snow Leopard with QT 10. Absolutely no options for that on my Mavericks' QT 10.3. And then the Apple "help" site gi