We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,294 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Make a JAR contains a database

Hi
I just completed my database hospital application and now i'm ready to export it into a JAR file. I palced the DB in the classes subfolder and played with ClassLoader but got nothing!
I used the following code

String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String url="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=f:hospitalDb.mdb;}";

any idea how to make a JAR file for a database application?

i would be grateful

P.S:i'm using MS Access

3
Contributors
7
Replies
1 Day
Discussion Span
8 Months Ago
Last Updated
9
Views
Question
Answered
ringo_tech
Light Poster
28 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I don't know if the DB program knows how to read a DB that is inside of a jar file.

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

may be i wasn't clear. i want to convert the jar into an .exe application so i can install any where.
so what i want exactly is to access my DB from any path<and how could i read that path?

ringo_tech
Light Poster
28 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

convert the jar into an .exe application so i can install any where

Do .exe files run on linux and macs?

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

i'm working in windows platform

ringo_tech
Light Poster
28 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

well, yes, but turning it into an .exe will prevent you from running it 'anywhere', not make it possible to do so. a .jar is a platform independent executable, so just keep that.
also: why putting the db in the .jar?

stultuske
Industrious Poster
4,379 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 24

Put the DB file in a standard location on all PCs that use your code.
The user.dir folder for example.

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

i wanted to access it from any path accorrding to where the user installs the application but i give up.
i will put the DB is a standard location as you said

ringo_tech
Light Poster
28 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 8 Months Ago by NormR1 and stultuske

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0801 seconds using 2.71MB