Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Access access

  Asked By: Trupti    Date: Jul 12    Category: Java    Views: 828
  

I'm rather new to Java and JavaScript, so if this question has been answered
before, please bear with me.

I've written a simple test program for a class project. It will ask ten
questions, provide four answers for each question, allow the user to select
an answer and at the end of the test it will give the correct answers to all
the questions as well as the user's answers and score. As is, it works but
needs tweaking.

Now for my question; I think this program could be quite useful to my fellow
students if it could be expanded a little. I was thinking, if the questions
and answers could be retrieved from a database, such as Access, it would be
much easier to add, modify, delete etc. the questions and the program could
be used for more than one subject.

My question is, what would be the best way to directly interact with Access
from Java. Can it even be done? I've played a bit with JavaScript - Perl
and the Server Side scripting thing, but what I'm hoping to do is develop
something that won't require server access ... ie. the database can be kept
on your local drive.

Any suggestions are welcome.

When I get this thing working, I'm planning to offer it free to anyone who
wants it. The original Java program works now, but it uses five arrays and
a switch statement and only accepts ten questions and answers. It could be
expanded, but it would be very unhandy to use as is for more than
twenty-five questions or so.

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Terence Mitchell     Answered On: Jul 12

I can suggest you one way of implementing it.

U can make as many as TEXT files in which all the
questions will be stored and there answers will be
stored in database.

now what to do is...Use file access  technique, read
the complete file for one question  and displayed it in
TEXTAREA making it uneditable...use four buttons to
get the answer  and then match all of them from the
database.

This mathod will be very useful for you, as these kind
of programs are known as Test Simulator.

 
Answer #2    Answered By: Adalwin Fischer     Answered On: Jul 12

I do not think the way of putting data in local
computer would result much success. As user  tends to
access the database  directly so that result can be
easily known.
I think better way is to access  the question  through
the Access. Instead of accessing the whole question,
you may store predefined STring in client like
!. Choose the correct  questions below
which is the correct answer  etc.,
Morever, I think there is no need of constructing four
arrays.
try to use random function. So that answer can be
randomly assigned i.e., a b c d
In case local  drive, you should password protect the
Access file.

I do not think the way of putting data in local
computer would result much success. As user tends to
access the database directly so that result can be
easily known.
I think better way is to access the question through
the Access. Instead of accessing the whole question,
you may store predefined STring in client like
!. Choose the correct questions  below
which is the correct answer etc.,
Morever, I think there is no need of constructing four
arrays.
try to use random function. So that answer can be
randomly assigned i.e., a b c d
In case local drive, you should password protect the
Access file.

 
Answer #3    Answered By: Skye Hughes     Answered On: Jul 12

You can connect java  to ms access  by using jdbc. You
can refer to http://www.javaalmanac.com for more info
on how to do it. It would be easier to just create
the application in access though instead of coursing
the data to java. Nevertheless, it is possible and i
have done it already.

 
Didn't find what you were looking for? Find more on Access access Or get search suggestion and latest updates.




Tagged: