×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2006
    Location
    Southampton
    Posts
    12

    Unhappy Records of RecordStore still available?

    Hello everyone,

    I am storing some data into RecordStores for my application and there was no problem till now...I retrieve some data from a servlet (byte[]) and store it into a RS. But when it comes to the point where the data should be displayed the application still uses the data I have used before, stored by the MIDlet itself, although the method isnt used anymore and the simulator has been restarted several times...

    The following code snippet shows the method of the MIDlet...

    Code:
    public void storeData_v2() 
    	{
    		HttpConnection conn = null;
    		InputStream is = null;
    		OutputStream os = null;
    		
    		try 
    		{
    			String url = "http://localhost:8080/httpconn/servlet";
    			conn = (HttpConnection) Connector.open(url);
    			conn.setRequestMethod(HttpConnection.POST);
    			
    			os = conn.openOutputStream();			
    			is = conn.openInputStream();
    			
    			int length = (int)conn.getLength();
    			byte[] data = new byte[length];
    			is.read(data);
    			
    			try 
    			{
    				week = RecordStore.openRecordStore("week", true);
    				
    				week.addRecord(data, 0, data.length);
    				
    				week.closeRecordStore();
    			} 
    			catch (RecordStoreFullException e) 
    			{
    				e.printStackTrace();
    			} 
    			catch (RecordStoreNotFoundException e) 
    			{
    				e.printStackTrace();
    			} 
    			catch (RecordStoreException e) 
    			{
    				e.printStackTrace();
    			}
    		} 
    		catch (IOException e) 
    		{
    			e.printStackTrace();
    		}
    		finally
    		{
    			try
    			{
    				if(os!=null)os.close();
    				if(is != null)is.close();
    				if(conn != null)conn.close();			
    			}
    			catch(IOException ioe)
    			{
    				ioe.printStackTrace();
    			}		
    		}
    	}
    I also tried to delete the RecordStore before it is created once more, but the effect was the same.

    Is there the possibility to delete the RecordStore by myself?

    I use Eclipse 3.1.1 with WTK2.1. Everything runs with MIDP2.0 and CLDC1.1.

    Thanks in advance for every help.
    Melanie

  2. #2
    Registered User
    Join Date
    Mar 2006
    Location
    Southampton
    Posts
    12

    Re: Records of RecordStore still available?

    Sorry...I solved the problem just by myself...I had the delete statement in the wrong method...

    This thread can be closed or deleted...thanks!

Similar Threads

  1. VERY interesting discovery about Nokia 6230 RecordStore
    By mortem in forum Mobile Java General
    Replies: 5
    Last Post: 2007-11-19, 14:24
  2. Series40 RecordStore limitations unclear
    By bongio67 in forum Mobile Java General
    Replies: 0
    Last Post: 2004-12-16, 17:23
  3. Series 60: RecordStore size (rms.db file) keeps growing...
    By aspaans in forum Mobile Java General
    Replies: 1
    Last Post: 2004-02-19, 05:09
  4. Delete/sort records from RecordStore?
    By artemg in forum Mobile Java General
    Replies: 0
    Last Post: 2004-01-09, 19:33
  5. nokia 3410 - problem with deleting records from a recordstore
    By tillstoschus in forum Mobile Java General
    Replies: 0
    Last Post: 2002-11-11, 21:24

Posting Permissions

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