J2ME Filter Class
=============
Hi, i am a J2SE familiar with web development. I normally will use SQL Statement to query my database.
Now with J2ME's RMS system, i am stuck and lost on querying database.
This is my database structure in RMS.
Year|Month|Day|Expenses_Ty
pe|Expense
s_Mode|Amo
unt|Remark
So, i wish to select certain record base on the condition something like this
SELECT * From [table_name] where Year ='XXX' and Month='YYY'
I have able to retrieve the entire record in RMS with this code:
..
..
recordstore = RecordStore.openRecordStor
e("databas
e_name", true);
byte[] byteInputData = new byte[500];
ByteArrayInputStream inputStream = new ByteArrayInputStream(byteI
nputData);
DataInputStream inputDataStream = new DataInputStream(inputStrea
m);
for (int x = 1; x <= recordstore.getNumRecords(
); x++) {
recordstore.getRecord(x, byteInputData, 0);
input_id = inputDataStream.readInt();
input_year = inputDataStream.readUTF();
input_month = inputDataStream.readUTF();
input_type = inputDataStream.readUTF();
}
..
..
I have also read the J2ME Filter in here
http://www.java2s.com/Code/Java/J2ME/Demonstratessimplerecordsortingandfiltering.htm and i notice it's only able to search a single phrase or column only. So, not able to match what i want.
Thus, this is my question.
1. How can i preform similar operation (SELECT Query) in J2ME RMS database? Is there any other way for me to achieve the above SQL statement?
2. The Filter option from J2me, am i right that it's only useful when you wish to search a single text ONLY?
3. Can you suggest any other useful URL for my as a reference code? I am a beginner in J2ME and notice it's kind of "restricted" as mostly many classes is not available.
Thank you.