×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    111

    J2ME DB CONNECTIVITY

    Hello,
    I want connect my database created in access with my j2me code.
    How can I do this?
    Can you provide some codes?

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,553

    Re: J2ME DB CONNECTIVITY

    http://wiki.forum.nokia.com/index.ph...ta_from_server

    http://wiki.forum.nokia.com/index.ph...tps_in_Java_ME

    http://wiki.forum.nokia.com/index.ph...ent_in_Java_ME

    http://wiki.forum.nokia.com/index.ph...est_in_Java_ME

    You then need to write the server-side code to correspond to the client (and have the server-side do the database access for your client app).

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    111

    Re: J2ME DB CONNECTIVITY

    Hi,
    What is the package need to be imported for j2me db connectivity?

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,553

    Re: J2ME DB CONNECTIVITY

    There is no "package" to "import". J2ME has no built-in, direct database connectivity support. You have to design/code it yourself using TCP/IP socket calls or higher-level protocols like HTTP.

  5. #5
    Registered User
    Join Date
    Aug 2010
    Posts
    111

    Re: J2ME DB CONNECTIVITY

    Hi,
    Is there any built in application for j2me db connection in WTK2.5.1 or anywhere else ?

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: J2ME DB CONNECTIVITY

    Quote Originally Posted by lovely_chatterjee View Post
    Hi,
    Is there any built in application for j2me db connection in WTK2.5.1 or anywhere else ?
    Did you read the Post Number 2?
    Everything is there, in details whatever you will need,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Aug 2010
    Posts
    111

    Re: J2ME DB CONNECTIVITY

    Hi,
    I am trying to create a recordstore to store data in j2me. I have written some code but it is not running and gives some errors.
    Can you tell why is the code not running?
    Here the code is:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.rms.*;
    //import javax.microedition.rms.RecordStoreException;

    public class RecordStore extends MIDlet

    {
    Form mainForm;
    public RecordStore ()

    {
    String con_name=null;
    String con_loc=null;
    int con_num=0;
    try
    {
    mainForm = new Form ("RMS");

    RecordStore rs = RecordStore.openRecordStore("MyContacts", true);

    rs.con_name = "abc";
    rs.con_loc = "aa";
    rs.con_num = 111;
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream os = new DataOutputStream(baos);
    os.WriteUTF(rs.con_name);
    os.WriteUTF(rs.con_loc);
    os.WriteInt(rs.con_num);
    os.close();
    byte[] data = baos.toByteArray();
    int id = recordStore.addRecord(data,0,data.length);
    /*byte[] data1 = baos.toByteArray();
    DataInputStream is = new DataInputStream(new ByteArrayInputStream(data1));
    rs.con_name = is.readUTF();
    rs.con_loc = is.readUTF();
    rs.con_num = is.readInt();
    mainForm.append(con_name);
    mainForm.append(con_loc);
    System.out.println(con_num);
    is.close();*/
    rs.closeRecordStore();
    }

    catch(Exception e1){}
    }
    public void startApp()
    {

    Display display = Display.getDisplay (this);
    display.setCurrent (mainForm);
    }
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}
    }

Similar Threads

  1. Help!How to convert pc db file into symbian db
    By yaohongwang in forum Symbian
    Replies: 2
    Last Post: 2008-06-18, 09:52
  2. about .db editor on pc or vb connect .db file
    By kingqq007 in forum Symbian
    Replies: 2
    Last Post: 2008-01-29, 14:13
  3. J2ME to DB via Bluetooth
    By jafar_pal in forum Bluetooth Technology
    Replies: 1
    Last Post: 2007-09-22, 15:45
  4. accessing rms.db in j2me
    By niraj_gandhi in forum Mobile Java General
    Replies: 16
    Last Post: 2007-02-10, 08:27
  5. A new j2me device db project
    By sebflash in forum Mobile Java General
    Replies: 0
    Last Post: 2006-03-21, 15:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×