NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

How to convert to embedded database

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
mn1247



Joined: 04 Jan 2011
Posts: 64

PostPosted: Tue Feb 01, 2011 4:53 pm    Post subject: How to convert to embedded database Reply with quote

I'm building a Desktop Application and have worked thru the tutorial:

http://netbeans.org/kb/docs/java/gui-db.html

My understanding is that there must be a derby server running in order to run the application's jar file. However, I can avoid this requirement by having an embedded derby database.

Is this true? If so, how do I convert the application so that the database is embedded?

Thanks
Eric
Back to top
pelz



Joined: 07 Mar 2010
Posts: 162
Location: Magyarország

PostPosted: Tue Feb 01, 2011 9:59 pm    Post subject: Reply with quote

Did you try this? http://lmgtfy.com/?q=embedded+derby
Back to top
mn1247



Joined: 04 Jan 2011
Posts: 64

PostPosted: Wed Feb 02, 2011 11:54 am    Post subject: Reply with quote

I must say, the sarcasm factor runs high on this forum.

I'll take this to mean, "Yes, Eric, an embedded database will avoid the need for a server. Here's a link for converting"

I realize this is all old-news to many of you, but for someone who is just getting started - for whom derby is a type of hat and embedded is what becomes of your car on a muddy road - a simple answer that points in the right direction can be very helpful.

e
Back to top
pelz



Joined: 07 Mar 2010
Posts: 162
Location: Magyarország

PostPosted: Thu Feb 03, 2011 2:50 am    Post subject: Reply with quote

I think, if you want to change to other database, you must change the connection string only in the in the persistence.xml in the package of "META-INF". See the picture!


persist.png
 Description:
 Filesize:  131.28 KB
 Viewed:  2178 Time(s)

persist.png


Back to top
mdeggers



Joined: 28 Jan 2009
Posts: 208

PostPosted: Thu Feb 03, 2011 6:55 pm    Post subject: Reply with quote

Here are some pointers:

http://db.apache.org/derby/quick_start.html

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

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

http://wiki.apache.org/db-derby/WorkingWithDerby#Tutorials

In particular, at least one embedded example (outside of the one on the
Derby site):

http://www.techbookreport.com/tutorials/apachederby.html

That's just the start.

And here's the complete address book application using an embedded
database:

http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javadb/

The Google search for the above link was: embedded derby example

I haven't tried any of these, since I mostly use Derby from a connection
pool in Tomcat.

. . . . just my two cents.

/mde/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo