Error in updating file

Hi im doing project using jsp files.In part of my project there is vote page and vote result page.
my vote_page.jsp
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.sql.Date" %>
<%@ page language = "java" %>
<%! int ctr=0;%>
<%! String[] songs=new String[10];%>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connect;
connect=DriverManager.getConnection("jdbc:odbc:RegisterDataSource");
Statement state;
state = connect.createStatement();
String strQuery1 = "SELECT title FROM ItemEJBTable";
String str;
ResultSet result1 = state.executeQuery(strQuery1);
while(result1.next())
songs[ctr]=result1.getString("title");
ctr++;
connect.close();
catch(Exception e)
%>
<form method="GET" action="http://localhost:8000/Music/Vote_result_page.jsp">
<p align="center">
<font><b><u>Vote for your favorite song</u></b></font></p>
<font><b>       Songs</b></font>
<font> </font>  
<select size="1" name="Song1">
<%
for(ctr=0;ctr<songs.length;ctr++){
%>
<option>
<% out.println(songs[ctr]);}%>
</option>
</select></td>
</tr>
</table>
<input type="submit" value="Vote" name="submit">and my vote_result_page.jsp
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page language = "java" %>
<%! int voteNum=0; %>
<%! String selSong=new String();
%>
<% selSong=request.getParameter("Song1");
out.println(selSong);
String selSong1 = selSong.trim().toString();
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connect;
connect=DriverManager.getConnection("jdbc:odbc:RegisterDataSource");
Statement state,state2;
ResultSet result1;
state = connect.createStatement();
state2 = connect.createStatement();
String strQuery1 = "update Vote_Info set Number_votes=Number_votes+1 where itemCode=(select itemCode from ItemEJBTable where title='"+selSong+"')";
state.executeUpdate(strQuery1);
String strQuery2="select Number_votes from Vote_Info where itemCode = (select itemCode from ItemEJBTable where title='"+selSong1+"')";
result1=state2.executeQuery(strQuery2);
while(result1.next())
voteNum=result1.getInt("NumberVotes");
out.println(selSong+" got "+voteNum+" votes");
connect.close();
voteNum=voteNum+1;
catch(Exception e)
%>
<td width="82%" valign="top">
<!--Display the number of people who have voted for the song-->
<p align="left"><font face="Arial" size="3" color="#800000"><b><u>You voted for the song:</u></b></font>
<p align="left"><font face="Arial" size="3" color="#800000"><b><%=request.getParameter("Song1")%></b></font></p>
<p align="left"><%= voteNum %> <font face="Arial" size="3" color="#800000">people have voted for this song so far.</font></p>
<input type="submit" value="OK" name="submit">When i select song_no_1 and click on vote button on vote_page.jsp it directs to vote result page and displays that
1 person has voted for this song and this vote is not updating on table. When i go again to vote page and vote on song_no_2 it says that "2 person have voted this song" even if it is not voted before.
I dont no where the problem occurs pls help me for this.
hi pls help me..
Edited by: merwyn on Mar 27, 2009 11:03 AM
Edited by: merwyn on Mar 27, 2009 6:44 PM

Sorry, the code is very cluttered and unoverviewable. The motivation to extract all the separate parts/tasks out of the code to allocate your problem is very little. You need to split the code in clear parts each doing its own task independently. This way you can also just debug/test every part independently so that it is more clear where the actual problem lies. Database interaction? Request processing? Request controlling? Data presentation? Configuration settings? Etcetera.
Use a JSP file for pure data presentation only. You can use taglibs/EL to access javabeans in any scope.
Use a Servlet class to process the request, talk with the DAO class, store the data in a scope and forward the request to a JSP file.
Use a DAO class to interact with the database using JDBC and takes/returns the data in javabeans.

Similar Messages

  • [Solved] Error when updating: file exists in filesystem

    Hello all,
    While updating with pacman my laptop overheated and turned off.
    After rebooting I removed /var/lib/pacman/db.lck.
    When I resume pacman -Syu I get:
    http://pastebin.com/7c1iTgWG
    Is there any way to fix this or is a fresh install in order?
    Thank you very much for your help
    Last edited by vidar-mud (2012-11-21 18:50:29)

    Welcome to the boards. Please read our Forum Etiquette https://wiki.archlinux.org/index.php/Forum_Etiquette
    You should also read the stickies in Newbie Corner, notably the Common Problems and Issues one, where yours is described.

  • I have Microsoft Word for Mac 2011, version 14.3.1.  When I try to open a document, an error occurs, says file type is "blocked from opening in this version."  This was NOT immediately after a version update.  Any ideas?  Thank you.

    I have Microsoft Word for Mac 2011, version 14.3.1.  When I try to open a document, an error occurs, says file type is "blocked from opening in this version."  This was NOT immediately after a version update.  Any ideas?  Thank you.

    Take a look here:
    http://support.microsoft.com/kb/953266
    If that doesn't help, I'd suggest you take up the question in Microsoft's own forums or with Microsoft support.
    Regards.

  • Error while updating the configuration files (MOB20003)

    hi,
    After installing the BI 4.0 server, i am trying to configure mobile using mobile server configuration tool. When i enter all the information for non Blackberry option as i would like to access through ipad, its giving me the error message" Error while updating the configuration files (MOB20003)" Please advise.

    Hi Somesh,
    If i am not wrong, only a war file deployment is needed to make ipad work.
    This happens with URL hitting directly on the Server.
    If you want to configure VAS and VMS servers, let us know what configuration settings have been done.
    Regards,
    Atul

  • When downloading the new 10.7 update for itunes, an error message saying that there is an error writing to file, verify that you have access to this file comes up... what is this??

    When downloading the new 10.7 update for itunes, an error message saying that there is an error writing to file, verify that you have access to this file comes up... what is this??

    That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
    XP instructions in the following document: How to perform disk error checking in Windows XP
    Vista instructions in the following document: Check your hard disk for errors
    Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
    Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
    Does the chkdsk find/repair any damage? If so, can you get an install to go through properly afterwards?

  • File adapter error after updating to SP19 (INBOUND_BINDING_ERROR)

    File adapter error after updating to SP19 (INBOUND_BINDING_ERROR)
    Hi all,
      im having some troubles after the installation of SP19 (from SP16 in NW04) with File Adapter (File->Idoc scenario).
    In message monitoring (Adapter Engine), I have several messages with status "System Error". The error text is :
    <i>Received XI System Error. ErrorCode: INBOUND_BINDING_ERROR
    ErrorText:   ErrorStack: Error in sender agreement for party '', service 'LEGACY_DEV', interface namespace 'http://XXXXX.com/XXXXXX', interface 'INTERFACE_OB' No sender agreement found for , , , , ,</i>
    Im sure that the Integration Directory settings have not been changed. So I tried the following, but the problem persists:
    - Deactivation/Activation of File Adapter channel
    - check that user XIISUSER is not locked
    - checked SXI_CACHE (it seems ok)
    - Many CPA full refresh
    - Dummy modifications of File Adapter channels (a dummy modification of the description)
    - Reboot J2EE
    I've seen that someone else had problems after upgrading to SP19. I'd really appreciate any suggestion of how to solve my issue.
    Thank you
    Manuel

    Hi Prabhu,
      I've already tried to restart server, but nothing happened. (Before update to SP19, the interface worked well).
    This is the error log from message monitoring:
    <i> 2007-01-16 16:37:34 Success Channel cc_File_Snd_Bolle: Entire file content converted to XML format
    2007-01-16 16:37:34 Success Send binary file  "BOLLE_20061229142059.CSV" from FTP server "AS810T:/sapinbound", size 8733 bytes with QoS EOIO
    2007-01-16 16:37:34 Success Application attempting to send an XI message asynchronously using connection AFW.
    2007-01-16 16:37:34 Success Trying to put the message into the send queue.
    2007-01-16 16:37:35 Success Message successfully put into the queue.
    2007-01-16 16:37:35 Success The application sent the message asynchronously using connection AFW. Returning to application.
    2007-01-16 16:37:35 Success The message was successfully retrieved from the send queue.
    2007-01-16 16:37:35 Success File "BOLLE_20061229142059.CSV" successfully archived on FTP server "AS810T" as "/sapinbound/bolle/20070116-163735-245_BOLLE_20061229142059.CSV"
    2007-01-16 16:37:35 Success The message status set to DLNG.
    <b>2007-01-16 16:37:35 Error Received XI System Error. ErrorCode: INBOUND_BINDING_ERROR ErrorText:   ErrorStack: Error in sender agreement for party '', service 'LEGACY_DEV', interface namespace http://XXXXX.com/XXXXXX', interface 'INTERFACE_OB' No sender agreement found for , , , , ,
    2007-01-16 16:37:35 Error Transmitting the message to endpoint http://SERVERNAME:8000/sap/xi/engine?type=entry using connection AFW failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: INBOUND_BINDING_ERROR:. </b>
    2007-01-16 16:37:35 Success The asynchronous message was successfully scheduled to be delivered at Tue Jan 16 16:42:35 CET 2007.
    2007-01-16 16:37:35 Success The message status set to WAIT.
    2007-01-16 16:42:35 Success Retrying to send message. Retry: 1</i>
    After this, the system try to resend the message, and the same error appears several times.
    Ty,
    Manuel

  • Trying to update creative cloud, comes error: The installation program could not access the important files / directories. Try to run the installer again. (Error code: 43), please contact customer support. The same error comes updating Muse. Mac 10.9.5. W

    Trying to update creative cloud, comes error: The installation program could not access the important files / directories. Try to run the installer again. (Error code: 43), please contact customer support. The same error comes updating Muse. Mac 10.9.5. What shall I do?

    Alauda_positos I would recommend reviewing your installation log files to determine the exact directory which the installer is unable to access.  You can find details on how to locate and interpret your installation log files at Troubleshoot install issues with log files | CC - http://helpx.adobe.com/creative-cloud/kb/troubleshoot-install-logs-cc.html.  You are welcome to post any specific errors discovered to this discussion.
    For information on how to adjust file permissions please see Error "Exit 6" or "Exit 7" | Install log | Read, write, system file errors | CS5, CS5.5 - http://helpx.adobe.com/creative-suite/kb/error-exit-6-exit-7.html.

  • HT5654 iTunes auto update downloaded and installed on 28/01/2014. iTunes now won't launch and error message states file MSVCR80.dll is missing. Tried uninstalling and downloading/installing again to no avail. Any clues?

    iTunes auto-update dowloaded and installed on 28/01/2014. iTunes now won't launch and error message states file MSVCR80.dll is missing. Tried unistalling and downloading/installing again to no avail.  Any clues?

    Click here and follow the instructions. You may need to completely remove and reinstall iTunes and all related components, or run the process multiple times; this won't normally affect its library, but that should be backed up anyway.
    (99269)

  • When downloading updates for Quicktime 7 and Itunes 10 I keep getting an error saying that files shared by these updates has an invalid signature and that the downloaded has been removed.

    When downloading updated for Quicktime 7 and Itunes 10 I keep getting an error saying that files shared by these updates has an invalid signature and that the downloaded has been removed. If I don't get that message I get a message saying that the download was unsuccesful and that in order to download I need to go to tools and then select dowload only. Please help I really want to update my iphone!

    Thanks for helping out, but I already tried these steps.
    I even tried this on a iMac with similar results. The only difference was that the errorcode was called 2001 instead of 21.
    Today I took the phone to www.iphoneambulancen.dk. A guy (in Aarhus, Denmark) that specializes in iPhone repairs. I figured, that given his occupation he'd seen most errorcdes. Two hours later, he called me back, and told me that he had replaced the battery.
    So, it turns out that a broken battery can cause this behaviour.
    But thanks again

  • I keep receiving an error message, "unable to update files in cache"

    Yesterday I install the latest version of Firefox 3.6.14 and I'm constantly receiving an error message, "unable to update files in cache," is this a settings issue, and how can I fix the problem.

    Hi Terry, A post is the message that anyone has just typed in. When you replied to me, that was your post. I am replying to you so this is my post. Think of it as sending an email or mailing a letter at the "post" office.
    Now right at the top of the last post (message) you sent me is a Post#, then the date and time and under that the thread subject "Re: I am trying to download Adobe Flash Player 10 and I keep getting......
    The first time that you posted, you described your problem. The next post after that is #1 and so on.
    The Adobe Flash Player forum works very much like email except there are a lot of "threads". A thread is what each message you see is called. Everyone that registers can start their own thread (subject). Then other people see it and can post to your thread and try to help you with your problem.
    You did pretty good, you registered, and you started your first thread
    Now do you feel somewhat more relaxed?  Hope so.
    Take a look now and see if you can find the Post# and etc that I described above.
    Thanks,
    eidnolb

  • Update problem. "error writing to file c:\config.msi\22be9d65.rbf. Verify that you have access to that directory."

    Every time I try and update to the latest version, I get an error messages saying to manually do it from tools menu. After doing that, I get an error message saying "error writing to file c:\config.msi\22be9d65.rbf. Verify that you have access to that directory." I am the sole user on this computer and have full administrative rights to my computer. Why am I getting this? I REALY don't care if I upgrade or not but want to get rid of the stupid apple update crap that comes up everytime I turn my computer on. If there are no suggestiong on how to fix this issue, is there a way to turn apple update OFF?! I have Windows 7 Home Premium.

    Are you running Kaspersky security software on that PC? (There's been a few reports in recent times of Kaspersky interfering with iTunes installs, with that message being produced.)
    If there is Kaspersky on board, we should try some general-principles getting-past-security-software-interference troubleshooting.
    Download and save a fresh copy of the iTunesSetup.exe (32-bit installer file) or iTunes64Setup.exe to your Hard drive. (Don't run the install on line, and don't start the install just yet.)
    http://www.apple.com/itunes/download/
    Restart the PC. After the PC restarts do not open any applications. Disconnect from your network and/or the internet. Now switch off all your security software (firewall, antivirus, antispyware).
    Now start the install by doubleclicking the iTunesSetup.exe (or iTunes64Setup.exe) file you downloaded earlier.
    Reenable all security software prior to reconnecting to your network and/or the internet.
    Any better luck with the security software shut down?

  • I'm getting error messages that read, "unable to update files in cache"

    Ever since I've installed the latest version of Firefox onto my laptop, I've been getting a message error that reads, "unable to update files in cache," repeatedly. I was wondering if this is a settings issue?

    FYI... The problem is with web page that hosts the Applet. The the "cache_archive" element lets the page author specify which JAR files to store in local cache. The "cache_version" specifies the version number of each of those JAR files listed in the "cache_archive" element. If the page author put 4 JAR files in the "cache_archive" element, but only put 3 versions in the "cache_version" element, then you will get this error message. You should report the error to the page author.
    Hope this helps.
    Erik

  • [SOLVED] Error during update of LUKS header on device ./file

    dd if=/dev/zero of=./file bs=1M count=200
    cryptsetup luksFormat -s 512 -c aes-xts-plain64 -h sha512 ./file
    WARNING!
    ========
    This will overwrite data on ./file irrevocably.
    Are you sure? (Type uppercase yes): YES
    Enter LUKS passphrase:
    Verify passphrase:
    Error during update of LUKS header on device ./file.
    This only happens on my 1TB HDD (GPT, xfs filesystem).  I have 2 SSDs that do not throw the error. 
    I tested using a flash drive formatted as GPT and using xfs filesystem and it worked.
    Ideas?
    Last edited by not_sure (2013-03-01 02:50:32)

    Hmm... I didn't know you could do that. Are you sure it can? https://wiki.archlinux.org/index.php/Di … ison_table
    I thought dm-crypt basically did block level encryption.
    I guess this is a "virtual partition"? Maybe https://www.linux.com/community/blogs/1 … nux/280174 helps? It seems to mount it as loopback prior to encryption?
    Last edited by cfr (2013-03-01 01:07:16)

  • HT1338 Not able to down load itunes updates, error message: corrupt file could not be saved

    Not able to down load itunes updates, error message: corrupt file could not be saved try again another time.  All other update are able to download...... but not Itunes. 
    Note:  My internet service is DSL and very slow (military installation with no other option).

    Not able to down load itunes updates, error message: corrupt file could not be saved try again another time.  All other update are able to download...... but not Itunes. 
    Note:  My internet service is DSL and very slow (military installation with no other option).

  • When downloading itunes updates, i get an error that reads file folder for itunes media has an invalid character

    The error message read "file folder iTunes media has invalid character".

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout, or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

Maybe you are looking for

  • Compressed formats won't play in CD player

    Is there any compressed audio format I can use to burn a CD which will play in my CD players? I've tried most of the formats that iTunes offers, and none of them seem to work. Also: I've been burning onto CD-RWs, not CD-Rs. Does this matter? Thanks i

  • Nokia Xpress Browser - Conflicting Apps error

    the nokia express on my asha 201 is not functionig. It says conflicting applications when I try to use it. Itried resetting it but still to no avail. What should I do. Moderator's note: We provided a more appropriate subject so other members can easi

  • Oracle database server sizing

    I have to design a database for a client having a 1000 concurrent users. The database size would be 300GB. What should be the SGA and redolog buffers and redolog file sizes. How many Roleback segemtns are required. Any body can help me in this regard

  • Document date and creation date are diffrence

    dear all, please tell me the why are the document date and created on date. like customer code is created on 12.11.2011. but sales order created on 12.10.2010. what is the diffirence of above the issue. please solve the problem. rajiv kumar

  • ICal crash when viewing meeting notice

    When I view a meeting notice sent to me by someone else and then press done or try to copy a section of the notice Ical just closes. Request for report comes up and I send to Apple. Any one else had ths proble, Its frustrating if you need to get web