Major problem

Thanx...
I import those... now the error is not shown in tomcat server....
All the values fetched from database and shown on page, but after clicking the update button it does not update the values and sometimes it shows error..
the error is as follows:
do date format error action.
my code is:
<html>
<body>
<table>
<tr>
<td>
<%@ page import =" java.sql.Date.*" %>
<%@ page import =" java.text.SimpleDateFormat.*" %>
<%@ page import =" java.util.Date.*" %>
<%@ page import ="java.text.ParseException.*" %>
<%@ page import =" java.text.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page import =" java.util.Locale.*" %>
<%@ page import =" java.text.DateFormat.*" %>
<%
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd");
format.setLenient(false);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:pf","scott","ttlscott");
System.out.println("got connection");
%>
<%
String action = request.getParameter("action");
// Check if an update is requested
if (action != null && action.equals("update")) {
conn.setAutoCommit(false);
PreparedStatement pstatement = conn.prepareStatement(
"UPDATE sec_mast SET catg_code=?, face_val=?, pur_val=?, int_paid=?, int_recd=?, brkr=?, vou_no=?, vou_date=?, vou_amt=?, due_date1=?, due_date2=?, mat_date=? where sec_no=? and tot_val=? and lf_no=?");
pstatement.setInt(1,Integer.parseInt(request.getParameter("catg_code")));
pstatement.setInt(2,Integer.parseInt(request.getParameter("face_val")));
pstatement.setInt(3,Integer.parseInt(request.getParameter("pur_val")));
pstatement.setInt(4,Integer.parseInt(request.getParameter("int_paid")));
pstatement.setInt(5,Integer.parseInt(request.getParameter("int_recd")));
pstatement.setInt(6,Integer.parseInt(request.getParameter("brkr")));
pstatement.setString(7,request.getParameter("vou_no"));
java.util.Date vouDate = format.parse(request.getParameter("vou_date"));
pstatement.setDate(8, new java.sql.Date(vouDate.getDate()));
pstatement.setInt(9,Integer.parseInt(request.getParameter("vou_amt")));
java.util.Date DueDate1 = format.parse(request.getParameter("due_date1"));
pstatement.setDate(10, new java.sql.Date(DueDate1.getDate()));
java.util.Date DueDate2 = format.parse(request.getParameter("due_date2"));
pstatement.setDate(11, new java.sql.Date(DueDate2.getDate()));
java.util.Date Matur_Date = format.parse(request.getParameter("mat_date"));
pstatement.setDate(12, new java.sql.Date(Matur_Date.getDate()));
pstatement.setInt(13,Integer.parseInt(request.getParameter("sec_no")));
pstatement.setInt(14,Integer.parseInt(request.getParameter("tot_val")));
pstatement.setString(15,request.getParameter("lf_no"));
int rowCount = pstatement.executeUpdate();
conn.setAutoCommit(false);
conn.setAutoCommit(true);
%>
<%
// Create the statement
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery
("SELECT * from sec_mast ");
%>
<%
// Iterate over the ResultSet
while ( rs.next() ) {
%>
<tr>
<form action="security_update.jsp" method="get">
<input type="hidden" value="update" name="action">
<td><input value="<%= rs.getInt("sec_no") %>" name="sec_no"></td>
<td><input value="<%= rs.getInt("catg_code") %>" name="catg_code"></td>
<td><input value="<%= rs.getInt("face_val") %>" name="face_val"></td>
<td><input value="<%= rs.getInt("pur_val") %>" name="pur_val"></td>
<td><input value="<%= rs.getInt("int_paid") %>" name="int_paid"></td>
<td><input value="<%= rs.getInt("int_recd") %>" name="int_recd"></td>
<td><input value="<%= rs.getInt("brkr") %>" name="brkr"></td>
<td><input value="<%= rs.getInt("tot_val") %>" name="tot_val"></td>
<td><input value="<%= rs.getString("vou_no") %>" name="vou_no"></td>
<td><input value="<%= rs.getDate("vou_date") %>" name="vou_date"></td>
<td><input value="<%= rs.getInt("vou_amt") %>" name="vou_amt"></td>
<td><input value="<%= rs.getDate("due_date1") %>" name="due_date1"></td>
<td><input value="<%= rs.getDate("due_date2") %>" name="due_date2"></td>
<td><input value="<%= rs.getString("lf_no") %>" name="lf_no"></td>
<td><input value="<%= rs.getDate("mat_date") %>" name="mat_date"></td>
<td><input type="submit" value="Update"></td>
</form>
</tr>
<%
%>
</table>
<%
// Close the ResultSet
rs.close();
// Close the Statement
statement.close();
// Close the Connection
conn.close();
}catch(ParseException e) {
out.println("do date format error action.<br>");
} catch (SQLException sqle) {
out.println(sqle.getMessage());
} catch (Exception e) {
out.println(e.getMessage());
%>
</td>
</tr>
</body>
</html>

You see that button up that that says "code" select your code, and push this button. It formats the code much more nicely.
The error "do date format error action" is being printed out because of the following code:
try{
catch(ParseException e) {
out.println("do date format error action.<br>");
} Somewhere one of the dates you are formatting doesn't match the mask you have set on it. So it throws an exception.
Probably you need to put try/catch blocks around each individual date you are parsing to see if they succeed or not.
Are you allowed to enter empty dates? What happens then?
Also, you should always close your database connection and do cleanup in a finally statement, after the exception. That way you always ensure that it is done
ie
Connection conn = ...
try{
  code manipulating database
catch (anyExceptions){
finally{
  if (conn != null) conn.close();
}Cheers,
evnafets

Similar Messages

  • Another major problem after 10.4.8 update

    Hi everyone,
    I've never had any major problem with any Mac OS update yet until I had the crazy idea to install the 10.4.8 update last week. I wish I would have never done this. This is also the first time I wish I had Windows since I can't remember such a big screw up with any Windows update I've seen.
    But back to the problem, after the installation on my old 12" Powerbook (1.33GHz with an additional 1GB of RAM) the system got really slow. The harddisk was accessed all the time, so after reading some forums people said that Spotlight would run a re-index of the database which made sense to me. So I just let it run over night and the next day the permanent HDD access was gone, but whenever I tried to access a folder it took ages (HDD access again...). So I decided to reboot which took about 20 minutes until the desktop fully showed up and was useable. Again, I had HDD access all the time. After two hours or so it stopped again, but as soon as I clicked on something, for example a folder, it started again. At that point the Powerbook was simply not useable anymore because I couldn't even start a program.
    So I start browsing through several forums and many people suggested to re-install the 10.4.8 combo update again. That's what I tried, after a while I could only hear the HDD access running and running. The installer said 29 minutes left and progress bar didn't move any further. I had it running for over a hour like that. I couldn't abort it, I could start no other software, nothing. It still showed 29 minutes and the HDD was accessed all the time.
    So I restarted the Powerbook since this obviously wasn't going anywhere. Apple logo came up, the little gear spinning thing as well and of course I could hear the HDD being accessed. After two hours of doing this I aborted and decided to boot into safe mode to install the combo update. Again, same situation. HDD running like crazy and Apple logo, but no login screen coming up.
    So I decided to boot from the Install disk and have the disc utility check the HDD... but of course after selecting the language and clicking continue at the screen when the HDD first shows up it starts to access the HDD... I can't select the HDD, I can't even get to the DU, nothing. It's been running like that for hours now. It seems like whenever the HDD is involved in something the accessing starts and just keeps running without any result. The HDD is getting very hot already.
    I've never run into such a problem before, so I'm kinda clueless what to do next. I don't mind to reinstall, but I have some files on that HDD that I need (some notes in text files, some emails and so on).
    So at this point I can't boot into OS X to access the HDD and I can't use the installer disk to access DU or even reinstall if I wanted to. I don't think the HDD is broken, this only happened after the 10.4.8 update. It just seems that every HDD access takes hours and hours longer than it should.
    What options do I have to get my data from the disk? I'll try to install OS X to a new external drive tomorrow (need one with firewire first). If that doesn't help I thought about pulling out the HDD from the Powerbook and hook it up to my MacMini or an iMac.
    If anyone has any other suggestion or solved a similar problem before, please let me know.
    Best,
    Stephan

    See my FAQ:
    http://www.macmaps.com/WIFI1048.html

  • I am experiencing some major problems with my MacBook Pro. I have had some issues with it turning on/off at random times, but today, when starting, I get the grey start-up screen and a recovery bar. After filling in approx 1/4 of the way, the machine dies

    I am experiencing some major problems with my MacBook Pro. I have had some issues with it turning on/off at random times, but today, when starting, I get the grey start-up screen and a recovery bar. After filling in approx 1/4 of the way, the machine dies. After starting it in recovery mode, it will not allow me to download OS X Mavericks- it says the disk is locked. Any ideas? I do not have a back-up and do not want to erase everything before I have explored my options. Help?

    try forcing internet recover, hold 3 keys - command, option, r - you should see a spinning globe
    most people will tell you to do both pram and smc resets (google) and if you still have issues, either clean install (easy) or troubleshoot (hard)

  • I am having a major problem connecting to FaceTime. Message reads "unable to connect, check network connections". Yet I am online with Manila, Safari etc. any suggestions.

    I am having a major problem connecting to FaceTime today.  Message reads "unable to connect, check network connections".  I am online, mail works, ex
    Tc.  This was not a a problem two days ago.  Any suggestions?

    Could be that the servers are overloaded today.

  • 10.9.3 = major problem with fast user switching

    I've found a major problem with the 10.9.3 update with my 27" iMac, you probably won't see it if your on a laptop. I did all the updates in past few days i.e., 10.9.3 combo update, iTunes 11.2.1.
    Afterward I noticed a bug when Fast User Switching i.e. FUS. I have 5 accounts but the bug can be replicated with only 2.
    I login to userA  have some windows open but you can just open a Finder window. Now make the window at least half the with of the screen and move it to the right side of the screen. Then login in to userB and setup the windows the same way as userA. Now FUS to userA and then back to userB. You will notice that the Finder window has been moved to the upper left corner of the screen. This problem happened's to all user accounts you login to except the first account you logged into.
    Since I didn't know what update caused the problem I had to use Time Machine to revert to my last version of 10.9.2. I then double checked the for the bug and sure enough everything was working fine. I now was going to install one update at a time and to see which one was causing the bug. So I installed 10.9.3 first and found the bug immediately.
    I now know what's happening. When the switch occurs the screen is resized to about the equivalent of a 13" MBP. At this point the windows that fall some ware outside that size get moved to the upper left corner and resized. Then the screen resizes to normal but it's too late, all the window have moved and been resized to fit the 13" screen size.
    You can reproduce this effect by going to System Preferences and selecting Display and then select the Scaled radio button. No select the smallest size, say, 1280 x 720. Now select the Best for display radio button again. You will now see all the windows you have open that were too big no moved and resized to the upper left corner. I know why the Mac moves the windows, it's so you don't have any windows stuck off screen.
    Now when I say 13" it could be some other size but it's about that size give or take.

    Yes, it's when you user Fast User Switching.
    Here's snapshot before the screen resized. Ignore the window in the lower right, I moved it from the upper left before taking the screen shot.
    I hate to say it but I'm glad I'm not the only one with this bug.

  • I have major problem,ios 5.1.1

    I have major problem with my 5.1.1 update ios, she does not want to settle, after the download an error message appears thank you for helping me!

    when the dowload end the error message is : iphone <my name> could not be updated because the firmware file is incompatible

  • I am having major problems with my trackpad on my macbook pro.  I can no longer press down on the bottom left and right corners for it to click and follow my command.  Please can anyone help?

    I am having major problems with my track pad on my macbook pro.  Even though my settings haven't changed...my trackpad is no longer responding as it did before.  The left hand corner no longer clicks when I press it and my personal commands which I set up in preferences no longer seem to be workin.  Please help!

    Some websites have an internal mute or volume setting. If that's not the issue, see below.
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data...
    and confirm. Close the window. Then select
               ▹ System Preferences… ▹ Flash Player ▹ Advanced ▹ Delete All...
    In the sheet that opens, check the box marked
              Delete All Site Data and Settings
    then click Delete Data. Close the preference pane.

  • Im having major problems syncing my iphone 4 to itunes, this problem started after upgrading to ios 5. I have upgraded my itunes, turned sync by wifi on and off but still nothing. Everytime I try to sync my iphone it just says sync cancelled. Please help!

    Im having major problems syncing my iphone 4 to itunes, this problem started after upgrading to ios 5. I have upgraded my itunes, turned sync by wifi on and off but still nothing. Everytime I try to sync my iphone it just says sync cancelled. Please help.....

    I'm having the same problem ! Each time the sync starts it suddenly stops and says finished syncing

  • New Version of BT Yahoo Classic Mail Major problem

    I have tried to use the new version of BT Yahoo Mail & have encountered a major problem.
    When I select any area of the new mail page I get a message that says "E Mail out of Memory Line 1"
    My computer then locks up totally, & I have to turn of with the on/off switch & restart.
    I have now gone back to using the original Classic mail, but, I find that if I select a e mail address from a web site this is automatically placed in the New Classic mail system, & again I get the message & lock up. 
    I have contacted India, & got nowhere! She said I had too many e mails stored on my system! I actually have 3726, so I think she is wrong
    Help please
    Should I just stick with the old version of the mail system?
    Is there anybody in BT interested in the problem?
    Will the original Classic mail continue for ever?
    Solved!
    Go to Solution.

    Johnoo wrote:
    To all who are viewing this, I have just had a mail from BT saying that they were having a few Bugs with the new mail system.
    I was advised to phone 0800 633 5335 Option 2, & they would action.
    I did this & I have been transferred back to the old Classic Mail system
    They then advised that I should wait at least one month before trying to reinstall the new system.
    Thought it best to share this information
    Huge thanks to you Johnoo, had been struggling for two days after upgrading from BT Yahoo Classic to new version, and had just reached the end of my tether so to speak!!!
    Followed instructions above - although Option 2 refers to 'Dial Up'? - and requested transfer back to Classic.  Contact centre operative seemed to understand perfectly
    I confirmed ID and she held on while I accessed mail account, took about a minute from start to finish!  Very happy
    Get busy living

  • Colour Profiles on exported images causing major problems

    I've been exporting keynote slides as png's to use in video presentations. The problem is that the png's are saved with colour profiles, which means if I export the images from diferent macs, or even the same mac but with a different monitor attached (therefore a diferent monitor colour profile active), the images have very noticeable colour variations.
    This is a major problem. I exported 1,000 slide transitions to import into Adobe Premiere, then about 500 slide updates that when imported, were in some cases darker or lighter even though I was using the same keynote and original images. I had to create a batch job in Photoshop to open, ignore the stored profile and save the images using a new default colour profile to try and get all the images consistent.
    There needs to be an option in either the Keynote preferences or export options to save exported images without colour profiles.

    There needs to be an option in either the Keynote preferences or export options to save exported images without colour profiles.
    No, there needs to be documentation on the ICC architecture and how ICC profiles are applied. Stripping out embedded ICC profiles will colour manage the objects (images) in the system, but when the images pass outside the system they will not be colour managed any more. In this scenario, either they will have to be rendered as deviceColor by the numbers, without a definition of the colours their colourants should form, or a source ICC profile will have to be assigned by the following system/application.
    I've been exporting keynote slides as png's to use in video presentations. The problem is that the png's are saved with colour profiles, which means if I export the images from diferent macs, or even the same mac but with a different monitor attached (therefore a diferent monitor colour profile active), the images have very noticeable colour variations.
    I could be considered an unconditional bug in Keynote if it embedded the current monitor profile and not the system RGB colour working space profile (: Generic RGB Profile). If indeed Keynote embeds the current monitor profile, it could be considered an unconditional bug in your understanding if you start by stripping the source profiles. You should be doing a profile to profile conversion in order to get into the RGB colour working space you want in Photoshop.
    Sorry, but it helps to have a basic understanding of media independent colour matching (even if the developers don't sometimes -:)).
    /hh

  • Facing a major problem while performing restoration of my mssql DB

    Dear Experts,
    I am facing a major problem while performing restoration of my mssql DB.  The situation is like
    1. I have successfully take full and transactional log backup in a external device using MSSQL Server Managemnt Studio.
        Backup was successfully completed as per MSSQL Server Managemnt Studio message.
    2. Try to restore the same using MSSQL Server Managemnt Studio. It is showing the following error
    System.Data.SqlClient.SqlError: RESTORE cannot process database <DB_SID> because
    it is in use by this session. It is recommended that the master database be used when
    performing this operation.
    I have followed the guidelines specified in the link 
    [SAP Help Link for Restoring the <SAPSID> Backup from a Device  |http://help.sap.com/saphelp_nw70/helpdata/en/f2/31ad56810c11d288ec0000e8200722/frameset.htm]
    But everytime I am getting the same error message. I have checked with all options but there
    was no resolutions. Kindly advise me in this regard.
    Thanks and Regards,
    Partha

    http://social.msdn.microsoft.com/Forums/en-CA/sqltools/thread/37ee8e24-7aaa-472b-861a-fc0cc513338a
    hope it helps

  • Help with major problem

    I have a major problem with my 4th generation iPod. Everytime I go to play it, it will skip songs when I don't want it to, pay for about 10 seconds and skip songs again. Sometimes it will play a song for while and then skip to another song halfway or it will just freeze up. I had this problem before and so I restored it. Now, it is still doing the same thing. I've tried restoring more than once and it still does the same thing. Why is this happening and how do I solve it?
      Windows XP  

    You could try a format of the iPod in Windows. A
    full format does a check and remap of bad sectors on
    the iPod hard drive, and you would need to restore
    the iPod as normal (using the iPod updater)
    afterward. This can also work when the iPod is
    recognized by the computer, but not by the updater.
    First, put the iPod into forced disk mode.
    See: How to put the iPod into disk mode.
    On your PC, go "my computer" and right click on the
    iPod, then choose "format". Ensure the settings are
    at "default" and that "quick format" is not checked.
    Now select "format". It will take a while, but when
    that's finished, restore the iPod using the updater.
    If you need to, reset the iPod to exit disk mode.
    So far so good except my iPod is not recognised by the updater so I can't restore it. What do I now?

  • Major Problems connecting ATV to iTunes

    I am having major problems in connecting to my iTunes on my PC. The ATV is not showing up in the devices list at all. It started after I reinstalled windows and reinstalled all the software after having major problems with the internet connection. The ATV is connected to the router with an ethernet cable and I can see it on the router home page. I have also done a full factory restore several times. I can access youtube on the ATV so the connection to the router is good. I can connect to the ATV from my laptop so I can assume the ATV is ok. I have tried everything in the the forum that has been advised and I have tried everything in the apple support also and as some one mentioned in other posts I have a very hot paper weight that I can watch crap youtube videos on!!!!
    Any help will be truely appreciated.

    Not necessarily -- it can still show up in the list but not be properly assigned a network ID (and not available to join the network) if there aren't enough clients available -- are you sure you have it set to at least 50? And you need to make sure you've cloned the Mac address as well if you have a cable modem. It won't hurt to check this. And make sure you try pinging the net ID of the ATV just to make sure it is responding (if not then the ATV unit itself is probably defective).
    Let's assume for a moment that both of these settings are fine and it does ping. At that point it almost surely is a permissions thing -- turn off security at the router if wireless (sorry -- this old man just got up and I can't remember if you are wired or not), turn off any firewall and if you have Norton turn it off as well (all of this just for the moment). Stop the iTunes service, reboot the ATV, and then bring up iTunes (which will start up the iTunes service).
    I need to shower and then I'm off to the courts (and perhaps I will have awakened and realized something else).

  • Having major problems connecting my iphone 5s to any wi fi.  Have reloaded completely, just 'Fails"?

    Having major problems connecting my iphone 5s to any wi fi.  Have reloaded completely, just 'Fails"?

    Having major problems connecting my iphone 5s to any wi fi.  Have reloaded completely, just 'Fails"?

  • Downloaded Mountain Lion and it caused major problems

    Down loaded Mountian Lion and caused major problems long story short had to reinstall Leopard then Lion but I lost my iTunes library. I thought if you had icloud you could recover you library. Or just log into iTunes and your library would appear. Appearantly not because I lost over 3k songs can someone help me with this if possible.

    Reinstall from your most recent backup...
    You can redownload iTunes purchases -> http://support.apple.com/kb/HT2519

  • Major problems using Keynote 09 with Keynote 08 files

    Keynote 09 seems to have been let out into the wild a bit too early. I have encountered several major problems when using it on older KN08 files. From the Scroll bar in outline view, to almost every movie or sound file being corrupted and requiring a "reinsert," to an annoyingly common problem with images losing their formatting. It seems that the new file format in KN09 does not play well with KN08 (this was not the case with any of the previous version upgrades).
    I have contacted Apple and shared these problems with them. I have removed KN09 from all my machines and have reverted back to KN08. Hopefully a future patch will correct this file corruption problem

    I have contacted Apple and shared these problems with them. I have removed KN09 from all my machines and have reverted back to KN08. Hopefully a future patch will correct this file corruption problem
    Your presentations sound like they are much more involved and memory intensive than mine. I only have a couple with movies/sound and those are quite short. So far (knock on wood) I've not had any of your problems. However, as a matter of course I always create a backup file before starting to edit an old important file with a new program. Keep us posted.

Maybe you are looking for

  • Credit charges based on the number of credit days offered to the customer

    AOA, I have a scenario. We have credit charges based on the number of credit days offered to the customer. This scenario will be executed on credit sales only. Example of pricing, a product mobile is offered to customer A on 20 Days credit Mobile   $

  • Keynote Edit Slide - Selecting a slide past 10

    Hello I have been experiencing an issue with the Latest Version of Keynote running on Yosemite Beta ( asking this question to determine if I need to install on another Mavericks machine) I have been creating a Presentation with multiple links to diff

  • Table Load Sequence - Referential Key Hierarchy

    I have a schema with around 100 tables. I need to load data in those table in such an order so that none of the referential integrity constraints fail while loading the data. Is there a way I can build a load sequence using some referential key hiera

  • What is the function with (line,",")

    I have three integer in a line seperated by two "," 1, 3, 4 the last one 4 without "," when use new StringTokenizer st = new StringTokenizer(line,";"); and s=st.nextToken(); the 1 and 3 can be reached but the 4 can not be reached can anybody give me

  • Bridge collections

    I have created a collection containing 127 Images.  I can add further images, which remain during the current session.  Howevetr, the added images dissapear when Bridge is closed.