Results 1 to 5 of 5

Thread: RecordStore class in java

  1. #1
    Join Date
    Nov 2009
    Posts
    862

    RecordStore class in java

    Can anyone from you give me the details about the RecordStore Class, so that it will be helpful to me. I have to create a CaseStudy on the RecordStore Class in java. So, if you give me some basic information then it will help me to create this casestudy by understanding it. So, please reply me.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: RecordStore class in java

    RecordStore class in java provides the methods below:
    • addRecord(byte[] value, int one, int two)
    • addRecordListener(RecordListener lst)
    • closeRecordStore()
    • deleteRecord()
    • deleteRecordStore(String one)
    • enumerateRecords(RecordFilter flt, RecordComparator cmp, boolean kept)
    • getLastModified()
    • getName()
    • getNextRecordID()
    • getNumRecords()
    • getRecord(int id)
    • getRecord(int id, byte[] bfr, int one)
    • getRecordSize(int id)
    • getSize()
    • getSizeAvailable()
    • getVersion()
    • listRecordStores()
    • openRecordStore(String name, boolean isyes)
    • removeRecordListener(RecordListener lst)
    • setRecord(int id, byte[] value, int one, int two)

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: RecordStore class in java

    Hello, I don't know the RecordStore class. But I have one code which will help you to get to know more about this class, if you want to know. Use the code below to get more knowledge about the working of RecordStrore class in java.
    Code:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.io.*;
    import javax.microedition.rms.*;
    
    public class Testing extends MIDlet
    {
    	private RecordStore rstore = null;
    	static final String str = "Testing";
    
    	public void startApp()
    	{
    		openRecStore();
    		writeRecord("One");
    		writeRecord("Two");    
    		readRecords();
    		closeRecStore();
    		deleteRecStore(); 
    	}
    
    	public void pauseApp()
    	{
    	}
    
    	public void destroyApp(boolean unconditional)
    	{
    		notifyDestroyed();
    	}
    
    	public void openRecStore()
    	{
    		try
    		{
    			rstore = RecordStore.openRecordStore(str, true );
    		}
    		catch (Exception e)
    		{
    		}
    	}    
    
    	public void closeRecStore()
    	{
    		try
    		{
    			rstore.closeRecordStore();
    		}
    		catch (Exception e)
    		{
    		}
    	}
    
    	public void deleteRecStore()
    	{
    		if (RecordStore.listRecordStores() != null)
    		{
    			try
    			{
    				RecordStore.deleteRecordStore(str);
    			}
    			catch (Exception e)
    			{
    			}
    		}      
    	}
    
    	public void writeRecord(String str)
    	{
    		byte[] rec = str.getBytes();
    		try
    		{
    			rstore.addRecord(rec, 0, rec.length);
    		}
    		catch (Exception e)
    		{
    		}
    	}
    
    	public void readRecords()
    	{
    		try
    		{
    			byte[] recData = new byte[5]; 
    			int len;
    			
    			for(int i = 1; i <= rstore.getNumRecords(); i++)
    			{
    				if(rstore.getRecordSize(i) > recData.length)
    				{
    					recData = new byte[rstore.getRecordSize(i)];
    				}
    				len = rstore.getRecord(i, recData, 0);
    				System.out.println("Record " + i + " : " + new String(recData, 0, len));
    		  	}
    		}
    		catch (Exception e)
    		{
    		}
    	}
    }

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: RecordStore class in java

    Hey, I also don't know about the RecordStore class in java. Where did you get this stuff. That means in which book you find the information about it. I have Complete Reference: Java 2, but in this book I am not able to find out any information about the RecordStore Class in java. So, if anyone has the details about it, then please give me that to me also. I am waiting for your reply. Please reply me.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: RecordStore class in java

    I am not having that much great knowledge about the RecordStore class in java, but have little information. This class basically represents a record store. And a record store consists of a collection of records. Why did it used, I don't know, but I think that you will able to get more information about it from the site of sun. You will able to get more information about the RecordStore class in java from this site, I suppose.

Similar Threads

  1. Converting java class to java bean class
    By Ucchal in forum Software Development
    Replies: 6
    Last Post: 09-08-2010, 10:24 AM
  2. KeyboardFocusManager class of java
    By Gokul20 in forum Software Development
    Replies: 4
    Last Post: 05-03-2010, 03:38 PM
  3. JDesktopPane class of java
    By Sonam Goenka in forum Software Development
    Replies: 5
    Last Post: 18-02-2010, 08:14 AM
  4. What is TransferSupport Class in Java?
    By DANIEL 602 in forum Software Development
    Replies: 4
    Last Post: 13-02-2010, 06:54 AM
  5. Java Programming Language Basics: Reflection Basics and Class Class
    By mayuri_gunjan in forum Guides & Tutorials
    Replies: 6
    Last Post: 29-08-2005, 12:04 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,566,860.39655 seconds with 17 queries