Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

J2ME and Websphere

  • 23-03-2004 03:24PM
    #1
    Closed Accounts Posts: 7


    Does anyone have any experience programming with J2ME or with IBM Websphere Studio Device Developer??

    Having a bit of trouble setting up a database to work with my Palm application.....

    Any help would be appreciated!!!


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    How are you accessing the DB? You talking about the recordStore?

    I use the sun toolkit at home with Eclipse. I can post what my setup is later.

    Never bothered to install WSDD is it any good?


  • Closed Accounts Posts: 7 qubeat


    It's decent enough - the problem I'm having though involves how to include the java.sql package as I'm hoping to use a database.

    In WSDD you start a project with a certain class library that suits you (in my case its a GUI app for Palm) and unfortunatly the java.sql isn't included within it so I'm not sure what to do.

    Would a recordstore be good or suitable for keeping names, phone no's etc??


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    J2ME is for devices, you can't just import other packages outside of the J2ME set.

    AFAIR there is a DB2 package, but you might be better off looking at personal java instead (do they have that for the Palm?)

    Recordstore is how you maintain data on your device however there is limitations on it. I think it is 8k limit you have to program for. Books at home so don't remember offhand.

    Plus you have to serialise your data to store your records.

    There is a tutorial on Developerworks.

    http://www-106.ibm.com/developerworks/edu/wi-dw-wi-data-i.html?S_TACT=104AHW05&S_CMP=EDU


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    scratch that.. its 8k minimum persistant storage devices should have.

    You can use the getSize() and getSizeAvailable to get the amount of space you can play with.

    MIDP1.0 you can only play with the same recordstore within the same applet. MIDP2.0 you can share datastores.


  • Closed Accounts Posts: 7 qubeat


    and would I have much functionality to play with such as searching for entries and things like that???

    Could I also do some sort of file i/o aswell??


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    There is no file I/O. You can make connections like..

    sms://123456
    http://localhost

    so maybe you can do

    file://file

    But I doubt it. The J2ME is meant for devices with limited memory/storage space (like phones). Thats why I suggested Personal Java.

    Recordstore has an abstract method called matches() that can be used to filter your results.

    Sample below will return a record if the first byte is a 4.
    public Class MyFilter implements
                       javax.microedition.rms.RecordFilter {
    
      public boolean matches(byte[] recordToCheck) {
          // You write the rest here. below is an example. 
          if (recordToCheck == 0) return false; 
          return (recordToCheck[0] == 4);
      }
    }
    


  • Closed Accounts Posts: 7 qubeat


    The info I got from palmone.com said the PersonalJava was not suited to Palm so they recommended MIDP.

    Yeah - think I'm gonna go with RMS - but is it slighty sluggish?? It seems slow accessing files??


Advertisement