Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,297 members, 7,811,889 topics. Date: Sunday, 28 April 2024 at 10:23 PM

How To Bundle Java Db Database In My App. - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How To Bundle Java Db Database In My App. (2379 Views)

Check My App Pin Pals Out / How To Deploy Application With Access Database In Vb.net 2008 / Inserting And Retrieving Images To/From Database In ASP.NET (2) (3) (4)

(1) (Reply) (Go Down)

How To Bundle Java Db Database In My App. by Danyl(m): 5:15pm On Mar 28, 2013
Good day, dear NLs, i just finished a database-driven application, i used java derby as my back end with the offline EmbeddedDriver version of d da drivers. Now i want to create an executable .exe file so i can create an installer for it,i used exe4j but the datasource couldn't be found. Please can someone guide me through on how to go about this.
NB. I used netbean for the application but itsn't the netbeans CRUD applications, just read-only mode of the database is in use.
Thank you.
Re: How To Bundle Java Db Database In My App. by javadoctor(m): 12:44pm On Apr 01, 2013
you can't create an installer for ur java program directly. you need to build ur application using netbeans platform profile,it can create ur installer fr mac,linux platforms. I guess you built a standalone application that runs in jar and u re tryin to convert it to windows exe,u can use programs like jar2exe to convert,but before building your application to jar in netbeans,ensure your persistence.xml table generation is on "createTable" else your tables won't be found in d database,and wen testing the jar application ,run them on d command prompt,it will notify u of the errors,probably the table issue u r having
Re: How To Bundle Java Db Database In My App. by Danyl(m): 10:45am On Apr 08, 2013
@javadoc,i'v done all dat,i've bn able to built some oda plain front-end apps into executables though they dnt av any back-end just utilities bt this one,i av a java derby db 4d back end,i convertd it into an .exe version,when i run it,the GUI showed up bt its not communicatn with the database n dats am tryin to fix,i changd my derby.system.home property,yet itsn't communicating, i usd a jar yersion of the db in my database url statement for the Class.forName() method,yet the .exe is running bt not communicatn, that is where i stand now
Re: How To Bundle Java Db Database In My App. by javadoctor(m): 11:48am On Apr 10, 2013
Run ur exe application using command,most of the underground connection to the persistence layer will appear on the console,it is there you will be notified of any errors. Try to click a button to connected to the database,like a search query,I'm sure it wil report d error
Re: How To Bundle Java Db Database In My App. by Danyl(m): 8:53pm On Apr 11, 2013
@java doctor, thnx, i got it fix already.
Re: How To Bundle Java Db Database In My App. by maekhel(m): 3:01pm On Nov 22, 2013
So hw do u solve it? Incase sum1 else run into similar problem
Re: How To Bundle Java Db Database In My App. by Danyl(m): 12:33pm On Nov 23, 2013
maekhel: So hw do u solve it? Incase sum1 else run into similar problem
cool... I used netbeans for the whole thing but right now I have bn able to fix the desktop stand alone. this is how I got it fixed.
1. I used java persistent api so in my persistence.xml file I changed my db url to jdbc:derby://localhost:1527/myDb; create=TRUE; d create=true line is to create d database afresh anytime u migrate d application or d db got missing.
2. after cleaning & building ur application add ur db to ur dist folder n add ur db to ur class path in d customize dialog... u cn get d customize dialog by clicking d customize link at d top of d netbeans window or select project properties n der u go.
3. distribute d app but mk sure u include a class or method dat starts ur database automatically every time u Run d application.
for a network distributable version I think one cn use tcp/ip protocol or RMI to mk remote or system on a wide or local area network to hv access to d database while u keep the db on d 'servers' system. I hope this helps

(1) (Reply)

How To Create Mobile Apps With Xamarin.Forms For iOS, Android, Windows / Good Book On Javascript / How To Build A CMS! Freedom From Wordpress..

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 19
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.