Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-11-2007, 06:58 AM
Member
 
Join Date: Apr 2007
Location: Singapore
Posts: 30
yuchuang is on a distinguished road
Send a message via MSN to yuchuang
Updating into 2 tables in the DB
Hi, i have a problem when updating into 2 tables in the DB.

Firstly, i have a table to store all the details and another table to store the attachment.

Secondly, i have a page to modify the details and the attachment. For the updating of the details is ok but when updating the attachment, there would have problem.

Users can choose whether to change the attachment file or not. if user choose not to change it, then it should remain the same attachment as before but i can't seem to achieve that. Instead it stores the attachment as blank after i update it.

Below is the codes i used to get the attachment from the browse textbox n stores into the DB.

Code:
if(oForm.getFile() != null){ if(oForm.getFile().getFileSize()>0){ oResearchPaper.setFiles(new HashSet()); oAtt.setFile(oForm.getFile().getFileData()); oAtt.setFilename(oForm.getFile().getFileName()); oResearchPaper.getFiles().add(oAtt); oAtt.setResearchPaper(oResearchPaper); } }
How do i do it in a way that when the browse textbox is empty and we click the update button, the attachment will still remain the same one, meaning the user don't want to modify the attachment.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-11-2007, 05:02 PM
Member
 
Join Date: Apr 2007
Location: Pennsylvania,USA
Posts: 46
sandor is on a distinguished road
Why does the update screen not have the name of the attachment right there on it like it has the other data?
..unless I am misunderstanding your question.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-12-2007, 07:54 AM
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
I think you need to tell us more about this , like the db you are using if JDBC then should tell the table structure ,etc By the way there is group called database with in the forum , It appeals to me that this topic should go there
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed with updating mysql database SilentCodingOne New To Java 1 12-11-2007 11:23 PM
Updating Local Content ibanez270dx Java Applets 1 11-02-2007 02:55 AM
Problems updating blob columns on Oracle 9 ljustiniano Database 0 08-14-2007 07:17 PM
dynamically updating clock malakaherath New To Java 2 08-01-2007 08:57 PM
Updating Graphics Greedful Java 2D 2 07-20-2007 08:12 PM


All times are GMT +3. The time now is 11:13 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org