Solved

standalone java database programme from cd..

Posted on 2001-06-15
11
168 Views
Last Modified: 2010-03-31
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
Comment
Question by:kahwoo
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 9

Accepted Solution

by:
Ovi earned 25 total points
ID: 6194981
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
 
LVL 6

Assisted Solution

by:dorothy2
dorothy2 earned 25 total points
ID: 6195116
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
 
LVL 2

Author Comment

by:kahwoo
ID: 6202177
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 6

Expert Comment

by:dorothy2
ID: 6202214
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
 
LVL 2

Author Comment

by:kahwoo
ID: 6202253
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
 
LVL 9

Expert Comment

by:Ovi
ID: 6202456
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
 
LVL 9

Expert Comment

by:Ovi
ID: 6202462
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
 
LVL 2

Author Comment

by:kahwoo
ID: 6213359
looks like i need to read more on serailized and deserialized file till then...
reagards kahwoo
0
 

Expert Comment

by:CleanupPing
ID: 9062039
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
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9253850
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question