Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to View the Contents from the Database?

 
Swaminathan Balasubramani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anyone help me...Pls!

I have a maintenence module in my project where i have to Upload new User entries,new department entries and delete
file entries.I have done the "Adding new user part" and "Adding new Depatment part". But i donno how to delete the exixting file
entries from the database..

I also have viewing the existing user information from the database. That is I have two command buttons names Previous and
next..On clicking the previous and next button the user should be able to view the information..

As im learing JAVA by myself i dont any one to guide me except for javaranch, im finding it very difficult to implement certain things which you may find simple..Pls try to help me with some ideas and preferably
with sample code..If anyone have done such type of servlet programming pls help me with sample codes..

Thanks for the anticipated reply

Swaminathan.B
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- How are you storing the file in the Database. Could you please provide the structure/relationship between user and file etc. Actually, file deletion shouldn't be a problem if you are comfortable with storing file into DB.

- You mean to say you dont know how to retrieve the next and previous records/record from DB. You can search the servlet/JSP/JDBC forums with the word "pagination". You will get a lot of post discussing the same thing.
 
Swaminathan Balasubramani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The structure of the Login information table is

Username Primary key
Password
Role

The structure of the Department table is

DeptID
DeptName

The Structure of File information table is

FileID
FileName
FileExt
DeptID---->Refers the Dept table
DateCreation
DateModified
Keywords
Path

Actually in the maintenence Screen, there are two text box depicting the USername and Password, and two command button for browsing the username and password which holds the value "Previous" and "Next".

When i press the button the corresponding action either prevous record or next record should be displayed in the Text boxes.

with regards,
Swaminathan.B
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swaminathan,

What you are looking for (a tutorial on using databases from Java) is beyond the scope of a forum like this.

I would start by following some tutorials on the web or by picking up a book on the subject.
http://www.google.com/search?hl=en&q=JDBC+TUTORIAL&btnG=Google+Search

Get yourself aquainted with JDBC from small command line apps, then look for a tutorial on Servlets.
http://www.google.com/search?hl=en&lr=&q=SERVLET+TUTORIAL&btnG=Search

If you get stuck on any particular issue, then, by all means, ask away. There are plenty of people here who are ready and willing to help.

PS:
A lot of us learned Java on our own (I was long out of school before Java was ever thought of ).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic