• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

servlet and jdbc (urgent)

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I am doing online test System.I am using Ms-Acess ,servlet and JSP.MY problem is
For each user ,I wanted to store his mark for each question in different table.Right now I am using only one table so every time I run the program it will count previous marks also.
I tried with seting autocommit to false.but didn't work.
After login by each user can I create table dynamicaly in servlet ?? IF yes then how?
thanks,
-padmashree
 
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would guess you can include user's name as table name in SQL statement using "CREATE TABLE" + username + .... .But this is going to be very expensive when you will have a table for each user. Try to utilize only one table, I don't think it's very hard.
- Alex
 
padmshree Patil
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I solved problem..
After login, I delete all rows from Result table..

Thanks for all help
-padmashree
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I may be missing the point here, but surely it's simple to do with one table (lets call it "exam"). you have columns "user" (text), "question" (number), "answer" (number?), "correct" (boolean)
When each user answers a question, place a new row in the table with the information on it, and calculate whether the answer was correct and store it in the "correct" column.
Then, to work out someone's score just use
SELECT COUNT FROM exam WHERE user="the user name" and correct=TRUE
Is this the sort of thing you were looking for.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by padmshree Patil:
I solved problem..
After login, I delete all rows from Result table..


Solved problem? Only if you don't expect more than one user at a time...
- Peter
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dear friend,
i have similar sort of query.
it goes as ...

> > i have a problem in multithreading which i am using
> > in my code
> > and i am not getting the path out of it.
> >
> > I have designed the servlets for online
> > examination.But the problem is that
> > only one user can give the exam at a time.
> > i have used two variables to trace score and
> > question number.
> > when one user logs in there is no problem.
> >
> > but in between if other one comes,
> > he gets his first question but his score is
> > incremented with the score of first user.
> > similarly his question.
> >
> > if user1 is on fourth question and his score=40;
> > user2 gets score=50 for his first right answer
> > infact it should be 10;
> >
> > i have incremented the score by 10 for each correct
> > answer.
> > the score and question_no are public variables.
> >
> > the test is for 10 questions and i am calling the
> > same servlet in a loop till the completion.
> > it is offcourse not fiesible to design n servlets
> > for n users.
> > i want the same servlet to be used by all the users.
> >
> > what should i do??
> > I am using jdk1.2.2 and Jsdk 2.0
> >
> > please mail me if you can help me.
> > thank you
> > sachin
 
sachin cknd
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my email is sachin_dabhade@yahoo.com
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic