Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

standalone java database programme from cd..

hi experts out there ^_^,

I am new in java, i would like to know whether it is possible to write a db program that involves ms access database, this application has to be burn in to a cd...
(this is an e-catalog cd)... no installation is to be done on the user computer. the cd are suppose to be autorun when inserted. data have to be display in a datagrid form and a search module can be implemeted as well. hope u guys can help. remember, i can't set the odbc, because it is a cd from distribution. ^_^  

no data are suppose to be stored in the user computer..

if possible please explain

regards
kahwoo

0
kahwoo
Asked:
kahwoo
  • 3
  • 3
  • 2
  • +2
2 Solutions
 
OviCommented:
Is possible but you must do the following :

1. burn on your cd a JRE too
2. use instead of Access an portable database system which doesn't use odbc, but an java driver (search at www.google.com for InstantDB for example).
3. create your ini file

0
 
dorothy2Commented:
This is certainly possible as Ovi indicates, however I think this will be a challenge for someone "new to Java". There are a lot of parts of Java you will need to understand - Swing, JDBC, Java deployment, etc. If your requirements force you to use Access, then you're not really worried about platform portability. Why Java then?

How many products are in the catalog? If small, have you thought about using XML?

What happens when the catalog gets new products? Are you going to burn and ship new CDs?

I'm not trying to give you a hard time, but there are some design decisions you might be able to make which would simplify your coding and cut your development time.

Good luck,

Dorothy
0
 
kahwooAuthor Commented:
thank guys

ok the data are like this

vehicle type
-------------
car
lorry

if car is the one...

car
---------------
honda
toyota

if toyota is selected

toyota
---------------
part a | serialnoA | price A    
part b | serialnoB | price B
part c | serialnoC | price C

this is how the data should be organized

so if possible could u experts suggest me what database should i use for this matter and how do i get it...

Ovi, i am not quite sure how to use the instantdb but i'll keep trying, any referece and help that i could get?

dorothy2, what is the advantage of using xml???

notes: this application is meant to be run in windows paltform only

regards
kah woo
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dorothy2Commented:
Use XML as an alternative to using a database if your product list is small (< 150 products). As a developer, you can leverage the code examples in Apache Xerces or another parser. Your catalog could be maintained by someone with clerical skills rather than database skills, and you could use a data type definition (DTD) to ensure that the revisions to the catalog contained the correct types of data (vehicle type, car brand, part description, part serial number, price).
0
 
kahwooAuthor Commented:
dorothy,
wow! that was fast ^_^
ok! back to the question, there are more than 5000
(5 thousand) of items (parts) is that ok??

ovi, i don't think the instantDB is free, is there any alternative that i can look into???

regards
kahwoo
0
 
OviCommented:
Sorry, I did not heard from any other. What you can do in other hand is to create import text files which will follow your structure, parse this files, create your own internal structure objects and make a simple serialization. After that put the application on the CD and when you start'it you simply deserialize your data and use'it.

To be more clear I explain again in greater detail :

1. Split your application in two distinctive parts, one called "Administrative" and the other "Commercial";
2. The Administrative application should be capable of parsing txt files following your data description and to create the coresponding serialized files.
3. The Commercial application should be capable to load serialized files and work with them.

Of course on your CD you write only the Commercial part and the serialized files. Why this ? Because if you write directly the txt files (or XML files) you have no sequrity in your data, this can be viewed by all people. The serialized files are Java coded files (unreadable).


More :

public class Car {
  private String type;
  private String name;
  private CarComponents[] parts;

  public Car(String t, String n, CarComponents[] p) {
    type = t;
    name = n;
    parts = p;
  }
  ......  get/set Methods ......
}

public class CarComponents {
  private String partName;
  private String serialNo;
  private int price;

  public Car(String pn, String sn, int p) {
    partName = pn;
    sn = serialNo;
    price = p;
  }
  ......  get/set Methods ......
}


Now you build an Vector of Car objects which must be serializable&deserializable and that's all.

I must leave now, but if you want more details about that we can continue tomorrow.

About .mdb driver I didn't found any on the web. So this is the most resonable solution in my opinion.
0
 
OviCommented:
Sorry, I did not heard from any other. What you can do in other hand is to create import text files which will follow your structure, parse this files, create your own internal structure objects and make a simple serialization. After that put the application on the CD and when you start'it you simply deserialize your data and use'it.

To be more clear I explain again in greater detail :

1. Split your application in two distinctive parts, one called "Administrative" and the other "Commercial";
2. The Administrative application should be capable of parsing txt files following your data description and to create the coresponding serialized files.
3. The Commercial application should be capable to load serialized files and work with them.

Of course on your CD you write only the Commercial part and the serialized files. Why this ? Because if you write directly the txt files (or XML files) you have no sequrity in your data, this can be viewed by all people. The serialized files are Java coded files (unreadable).


More :

public class Car {
  private String type;
  private String name;
  private CarComponents[] parts;

  public Car(String t, String n, CarComponents[] p) {
    type = t;
    name = n;
    parts = p;
  }
  ......  get/set Methods ......
}

public class CarComponents {
  private String partName;
  private String serialNo;
  private int price;

  public Car(String pn, String sn, int p) {
    partName = pn;
    sn = serialNo;
    price = p;
  }
  ......  get/set Methods ......
}


Now you build an Vector of Car objects which must be serializable&deserializable and that's all.

I must leave now, but if you want more details about that we can continue tomorrow.

About .mdb driver I didn't found any on the web. So this is the most resonable solution in my opinion.
0
 
kahwooAuthor Commented:
looks like i need to read more on serailized and deserialized file till then...
reagards kahwoo
0
 
CleanupPingCommented:
kahwoo:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
sudhakar_koundinyaCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[split points between dorthy2 and Ovi]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now