File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to View the Contents from the Database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to View the Contents from the Database?" Watch "How to View the Contents from the Database?" New topic

How to View the Contents from the Database?

Swaminathan Balasubramani
Ranch Hand

Joined: Apr 12, 2005
Posts: 38

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


B.Swaminathan<br /> <br />Mobile:+91 09886510453
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
- 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

Joined: Apr 12, 2005
Posts: 38
The structure of the Login information table is

Username Primary key

The structure of the Department table is


The Structure of File information table is

DeptID---->Refers the Dept table

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,
Ben Souther

Joined: Dec 11, 2004
Posts: 13410


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.

Get yourself aquainted with JDBC from small command line apps, then look for a tutorial on Servlets.

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.

A lot of us learned Java on our own (I was long out of school before Java was ever thought of ).

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: How to View the Contents from the Database?
It's not a secret anymore!