Link to home
Start Free TrialLog in
Avatar of kahwoo
kahwoo

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of Ovi
Ovi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kahwoo
kahwoo

ASKER

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
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).
Avatar of kahwoo

ASKER

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
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.
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.
Avatar of kahwoo

ASKER

looks like i need to read more on serailized and deserialized file till then...
reagards kahwoo
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.
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.