File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How can i store information about user on database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "How can i store information about user on database" Watch "How can i store information about user on database" New topic
Author

How can i store information about user on database

Rajpal Kandhari
Ranch Hand

Joined: Aug 26, 2000
Posts: 126
Hello Friends,
All of you who are regular visitor of this site know how the light bulbs and folde color works and what they represent. They are useful when you r accessing this site from the same machine. That is on which the cookies are stored abouit you're last visit on the site.

Now my case is different. I don't have a net connection. So i surf the net from the cafe. And every time i surf on the diff machine depending on the availability. So i am not able to keep track of new posting and could take the advantage of cookies set.
Insted i want to store the information about the user visiting the site in the database and base on that i would like to work on the light bulbs. In this case no matter from which computer it access this site it will get the same picture/corrrect light bulbs.
(I want to point out that i am working on the Java (servlet/Jdbc) version of this Discussion Forum)
So for that i will have to ask for username and password at the starting page. Am i right?

Ok i have a UserTable which store following information about the user:

column Name Field Type
UserName Text(25)
password Text(13)
email Text(50)
Address Text(100)
Occupation Text(50)
Interests Text(50)
RegisterDate Date/Time
EmailNotice yes/no
Ok apart from this what all information could i store so that i can keep track of when the user last looged on and accordingly i display the light bulbs and changed folder colors

Pls help me out.
Thanks,
Raj.


Regards,<P>Raj.<BR>-------------------------<BR>Afforts should be Appriciated.<BR>-------------------------
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Last logged on date would probably be helpful. vBulletin actaully works this way. Instead of relying on a cookie, it stores information about the last visit in a database. UBB doesn't use a database so this option is not available here.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Rajpal Kandhari
Ranch Hand

Joined: Aug 26, 2000
Posts: 126
Hello Thomas,
I really get confused between the two Paul. Any way excuse me if due to this confusion i happen to offend you.
Thanks for the suggestion. yes it can be done. But if i use this option then their is two possibilities.
1. I originally want all user visiting Discussion Forum have all the access till the Detail topic page. That is where all the replyies to a particular query could be seen.
2. If i use UserName and Password as log in information then i am restricting unregistered users to access the details.
3. Or i shall provide two option. One any one can access the information (prohibitted to Post a topic and reply to a topic) if he skips the username and password field. In this case light bulbs will also not work.
If a user log in at home page then he is given the information relevant to his login. So In this case i will only be able to control the user only if he logs in. Right Paul.

What is the URl od the vBulliten site?
Thanks,
Regards,
Raj.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Hi Rajpal,
If you don't mind, can I also join this discussion?
Right. But we need to store the 'LastVisitedDateTime' in database. Otherwise how can we differentiate a forum with new posts since his/her last visit from the other which got no new posts?
If we need to show the new posts for a particular user, somehow we need to identify the user. If we depend on cookies, you can't get the real info when you browse from cafe. So he/she has to login to give the identification I think.
regds
maha anna
Rajpal Kandhari
Ranch Hand

Joined: Aug 26, 2000
Posts: 126
Hello Maha Anna,
Nice to see you in my discussion. As with every one out here in JavaRanch i am also impressed by you're achivements and you're contribution to this site. In fact while reading you're posting i found out that we both think in the same way. That is other thing that i am not an intellectual person like you..you score at NTSE and at 12th and so on......
I also believe in sharing knowledge and helping others as we learn more by this. Now i am a regular visitor of this site. I am not active in answering to all the queries as most of my time goes in reading old post posted since Jan 1999. And i try to learn from other experiance. But now i have also started helping others. You can see that from search.
I am not sure ... but still i would like to inform you that i am working on making a copy of this Discussion forum using Servlets and Jdbc. As i am alone in New Delhi (not too many Good Java Professionals here) so i tried finding like minded people on net and this discussion Forum, but things didn't worked out. 90% were only intrested in getting the code.
Would you like to join me and help me out. What happened that i first made the full thing and was very happy. Then i realised that i have used procedural approach. Being the fact that i have written every thing inside class my code was procedural in nature that is I beging and come to an end and get what i want. But without using OOP's logic. So i worked on it and made my code object oriented. First of all i reduced all the duplication of my code by making proper classes and making object and using them. Second i made a separate class for database connection and used that. But i still think their is scope for lot of improvement in my code. And that is the reason i am not intrested in going forward in my creation unless my code is written using all the OOP's.
I am telling you all this because i want to as you "WOULD YOU LIKE TO HELP ME AND JOIN ME IN THIS CREATION".
if yes, then shall i mail you my first servlet with database at you're yahoo e-mail account?
Waiting for you're reply.
Thanks,
Regards,
Raj.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Thank you Rajpal for your kind words. Right now I am trying to balance between many things. I am afraid if I can join as a partner in the development cycle due to my limited free time. Definitly I TRY to help you if I can.
It is also a good idea to post here which I found myself very promising. Lots of very good helpful people and experience people visit here and share their knowledge.
Don't be hesistant to post here at all. We all learn at the same time.
Regards
Maha Anna
[This message has been edited by maha anna (edited November 29, 2000).]
 
GeeCON Prague 2014
 
subject: How can i store information about user on database