EasyDatabase is a custom class which I developed to manage and save application settings in your j2me applications instead of dealing with sometimes confusing methods of the javax.microedition.rms. It is a wrapper class around the RMS methods provided by MIDP 2.0.
It is very easy and efficient to use and requires no knowledge about MIDP Record Management System. It more or less works like how you store values in the windows registry(if you come from a windows background). Every value has a unique property name associated with it. For e.g AppVersion, LoginPassword, StudentsName, etc..
The code below demonstrates how to create a database called “UserInfo”. First we add the users “Name” & “Age”. Then, we retreive it and print it in the console.
EasyDatabase myDB = new EasyDatabase("UserInfo"); if(myDB.dBExists() == false) { myDB.createDB(); //creates the db myDB.addProperty("Name", "Dayson"); //adds name myDB.addProperty("Age", "20"); //adds age } myDB.updateProperty("Age", "25", false); //changes age System.err.println( myDB.getProperty("Name") ); //prints name System.err.println( myDB.getProperty("Age") ); //prints age
Similarly, we can create any number of databases, retrieve & store values as and when required.
The EasyDatabase.java file is what you need to download and include in your project. Every function is very well documented and most of the method names are self-descriptive. You can edit and adapt the code to your needs but remember to retain original author credits/e-mail id towards this website. So do download it & try it out…
Download: EasyDatabase.java
Hello, I found you at Altavista. You have wealth of information on your site and a nice design.