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 to View the Contents from the Database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
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
Author

How to View the Contents from the Database?

Swaminathan Balasubramani
Ranch Hand

Joined: Apr 12, 2005
Posts: 38
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


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
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

Joined: Dec 11, 2004
Posts: 13410

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 ).


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to View the Contents from the Database?