-2

I am developing a java dictionary application... I used jdbc for maintaining words but i realized that it won't work on other machines since i am making a desktop application... suggest me a way to maintain words other than files

Jaipal
  • 107
  • 1
  • 8

3 Answers3

1

I don't think there is an alternative to using files if you want to persist your data - it will have to be stored somewhere!

What about the following: - Use an in memory database that can be persisted to file (h2 for example) - Use XML persistance - there are plenty of libraries to help.

phn
  • 1,414
  • 1
  • 13
  • 9
  • thanq..I will look into XML persistence....if i use files if anyone somehow edit or deletes the file my entire data is uncertain or gone.. wht u suggest?? – Jaipal Apr 07 '14 at 12:17
0

My suggestion: http://www.manning.com/ingersoll/ :)

And after getting familiar with it, try Solr. https://lucene.apache.org/solr/

Btw: Please make your question more specific. As this is your first post, I upvoted the question. But think of all the guys around here, who have no knowledge about your problem. Everyone wants to help, but you have to provide more information.

Wintermute
  • 1,511
  • 1
  • 12
  • 33
  • #Wintermute i am developing a dictionary application using java...i want to make it like wordweb..i wanted to keep list of all words because to search the word i needed and find out its meaning....for maintaining words i initially used JDBC and Mysql but i realized it will not work in other machines – Jaipal Apr 07 '14 at 12:11
  • So it is a desktop application and should have all the words stored locally and not on a remote server? Is the list of words static or do you want the user to be able to update the list of words? – Wintermute Apr 07 '14 at 12:14
  • For the static part, you can store your data in a file in the java archive. Please check this answer: http://stackoverflow.com/questions/676097/java-resource-as-file – Wintermute Apr 07 '14 at 12:20
  • yes it is a desktop application...all the words are stored locally and list of words is static – Jaipal Apr 07 '14 at 12:22
  • So from a technology point this doesn't seems to be difficult. As another one suggested, you can go with a prepopulated in-memory database. Then you can access the words via JDBC/SQL... On the other hand, you can go with a text or xml file and place it in your jar-file. This file can be read from your application. So a user can not delete it or has to install it somewhere. It is always delivered with your application. – Wintermute Apr 07 '14 at 12:27
  • Thanq Wintermute...keep on helping me... – Jaipal Apr 07 '14 at 12:35
0

Why not use Embedded Derby?

It's platform independent, uses standard JDBC, and writes files which are accessible across any platform.

http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html

There's no reason why you cannot use JDBC in a standalone java application incidentally. Think of JDBC as a kind of socket you can plug into, but what's behind that socket is entirely implementation specific, and usually can be defined by configuration.

JCR is another good example of this, but this kind of engineering technique is plentiful in the Java universe.

SplinterReality
  • 3,360
  • 1
  • 20
  • 45