Results 1 to 11 of 11
  1. #1
    shyameni is offline Member
    Join Date
    Jul 2009
    Location
    Kandy, Sri lanka
    Posts
    16
    Rep Power
    0

    Default serializing an object to the same source package

    I want to store an object to an XML file in the same source package of the project. Is this possible to do without giving the absolute path to the file so that it will work in any machine??:confused: Plz help me with this.

    regards,
    shyameni

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    The source packages of your project are not used when running the program. You'll most likely just distribute a .jar file for other computers.

  3. #3
    shyameni is offline Member
    Join Date
    Jul 2009
    Location
    Kandy, Sri lanka
    Posts
    16
    Rep Power
    0

    Default reply

    hey thanks,
    but i want to write and read from that xml file during the execution of the jar file. When i insert it in the project folder it didn't work. Thatz why i thought putting it in the source package will work and accessible through the jar file.

    Or is there any other way to access a database which can be put inside the jar file with write and read is enabled.

    regards,
    shyameni.

  4. #4
    shyameni is offline Member
    Join Date
    Jul 2009
    Location
    Kandy, Sri lanka
    Posts
    16
    Rep Power
    0

    Default oh no

    oh plz someone help me......................

  5. #5
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Read about Derby if you want to embed a database.

  6. #6
    shyameni is offline Member
    Join Date
    Jul 2009
    Location
    Kandy, Sri lanka
    Posts
    16
    Rep Power
    0

    Default hey

    hey thanks, i'l do dt.

  7. #7
    shyameni is offline Member
    Join Date
    Jul 2009
    Location
    Kandy, Sri lanka
    Posts
    16
    Rep Power
    0

    Default

    I did the embedding a database with derby and still it is read-only. In my application i want to write to it also.

    So can someone help me to do it?? plz :)

  8. #8
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Do you mean that the database is read only? What happens when you run an insert or an update?

  9. #9
    shyameni is offline Member
    Join Date
    Jul 2009
    Location
    Kandy, Sri lanka
    Posts
    16
    Rep Power
    0

    Smile

    thanks for concerns,

    i think the problem was that the driver of the database was clientDriver not embeddedDriver, there was no option to change it to EmbeddedDriver.

    Can u plz tell me where can i change that option.

    I installed derby by following a tutorial in the web, i think i did it correctly.

  10. #10
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Follow the tutorials that come with derby itself. They explain both options.
    You should be able to update in both options anyway.

    P.S You didn't answer my question above?

  11. #11
    shyameni is offline Member
    Join Date
    Jul 2009
    Location
    Kandy, Sri lanka
    Posts
    16
    Rep Power
    0

    Smile

    sorry i dont dt code with me anymore, dtz why i couldnt answer ur question,
    i thought itz all useless and i deleted the whole project.

    Anyway u are saying that it should work both ways i mean with embeddedDriver and the clientDriver even after creating the jar file, then im happy bcos i can strive for something worthy and i hvnt got much time.

    thanks
    regards
    shyameni.:)

Similar Threads

  1. Replies: 7
    Last Post: 11-09-2009, 07:51 AM
  2. Replies: 4
    Last Post: 01-10-2009, 12:17 AM
  3. Replies: 1
    Last Post: 11-28-2008, 06:27 PM
  4. Object not serializing
    By MamboBanda in forum New To Java
    Replies: 1
    Last Post: 08-12-2008, 12:15 AM
  5. How do I omit an object when serializing?
    By Hasan in forum Advanced Java
    Replies: 1
    Last Post: 05-31-2007, 04:18 PM

Posting Permissions

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