Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-06-2009, 06:53 PM
Member
 
Join Date: Jul 2009
Location: Kandy, Sri lanka
Posts: 16
Rep Power: 0
shyameni is on a distinguished road
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?? Plz help me with this.

regards,
shyameni
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-06-2009, 07:11 PM
Senior Member
 
Join Date: Aug 2009
Posts: 1,895
Rep Power: 2
r035198x is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 11-07-2009, 03:19 AM
Member
 
Join Date: Jul 2009
Location: Kandy, Sri lanka
Posts: 16
Rep Power: 0
shyameni is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 11-07-2009, 10:46 AM
Member
 
Join Date: Jul 2009
Location: Kandy, Sri lanka
Posts: 16
Rep Power: 0
shyameni is on a distinguished road
Default oh no
oh plz someone help me......................
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 11-07-2009, 07:33 PM
Senior Member
 
Join Date: Aug 2009
Posts: 1,895
Rep Power: 2
r035198x is on a distinguished road
Default
Read about Derby if you want to embed a database.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 11-08-2009, 02:37 AM
Member
 
Join Date: Jul 2009
Location: Kandy, Sri lanka
Posts: 16
Rep Power: 0
shyameni is on a distinguished road
Default hey
hey thanks, i'l do dt.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 11-11-2009, 06:13 AM
Member
 
Join Date: Jul 2009
Location: Kandy, Sri lanka
Posts: 16
Rep Power: 0
shyameni is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 11-11-2009, 08:37 AM
Senior Member
 
Join Date: Aug 2009
Posts: 1,895
Rep Power: 2
r035198x is on a distinguished road
Default
Do you mean that the database is read only? What happens when you run an insert or an update?
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 11-11-2009, 04:01 PM
Member
 
Join Date: Jul 2009
Location: Kandy, Sri lanka
Posts: 16
Rep Power: 0
shyameni is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 11-11-2009, 07:26 PM
Senior Member
 
Join Date: Aug 2009
Posts: 1,895
Rep Power: 2
r035198x is on a distinguished road
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?
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 11-11-2009, 07:43 PM
Member
 
Join Date: Jul 2009
Location: Kandy, Sri lanka
Posts: 16
Rep Power: 0
shyameni is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The declared package does not match the expected package oneforall Eclipse 7 11-09-2009 08:51 AM
Serializing an object not working properly - funky chars. getstarted XML 4 01-10-2009 01:17 AM
MavenJava - browse source code of all open source projects online jirkacelak Java Announcements 1 11-28-2008 07:27 PM
Object not serializing MamboBanda New To Java 1 08-12-2008 01:15 AM
How do I omit an object when serializing? Hasan Advanced Java 1 05-31-2007 05:18 PM


All times are GMT +2. The time now is 05:17 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org