Solved

standalone java database programme from cd..

Posted on 2001-06-15
11
165 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now