[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

J2ME SQL Query : HOW

Asked by taiping in Java 2 Micro-Edition (J2ME)

Tags: j2me, sql, rms

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_Type|Expenses_Mode|Amount|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.openRecordStore("database_name", true);
            byte[] byteInputData = new byte[500];
            ByteArrayInputStream inputStream = new ByteArrayInputStream(byteInputData);
            DataInputStream inputDataStream = new DataInputStream(inputStream);

            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.

[+][-]10/25/07 12:33 AM, ID: 20145707Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10/30/07 02:31 AM, ID: 20175542Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Java 2 Micro-Edition (J2ME)
Tags: j2me, sql, rms
Sign Up Now!
Solution Provided By: keyurkarnik
Participating Experts: 4
Solution Grade: B
 
[+][-]10/30/07 04:52 AM, ID: 20176135Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11/13/07 05:35 PM, ID: 20276992Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]12/05/07 03:27 AM, ID: 20410381Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 / EE_QW_1_20070628