JSP Issues Converting Timestamps Correctly

I am pulling a timestamp from a DB2 database that has the date and time. When I pull the timestamp using the toString() function, it only gives me the year, month, and day, and dropping the time.
I initialize the SQL, and create the connection to the database in the first few lines, then read the date. It is the 4th item I am querying. There is a lot more to the code, but is a bit confusing. I altered it to be a bit more concise just to draw the gist of what I am trying to do.
The account number (dsrc_acct) is a parameter that is passed into the JSP, and pulls back relevant information:
String tSql = "select a.entity_id, a.first_name || ' ' || a.last_name, coalesce(c.addr1, '') || coalesce(', ' || c.addr2, '') || coalesce(', ' || c.city, '') || coalesce(', ' || c.state, '') || coalesce(', ' || c.country, '') || coalesce(', ' || c.postal_code, ''), d.txn_timestamp from name a, dsrc_acct b, address c, gem_event d where a.dsrc_acct_id = b.dsrc_acct_id and b.dsrc_acct_id = c.dsrc_acct_id and b.dsrc_acct = '" + request.getParameter("dsrc_acct") + "'";
int tRowCount = 0;
Statement dataCmd = null;
ResultSet conRS = null;
dataCmd = conn.createStatement();
conRS = dataCmd.executeQuery(tSql);
if ((conRS != null) && (conRS.next()))
out.print ("<table border = '0' width = 1850px>");
ResultSetMetaData rsmd = conRS.getMetaData();
int numberOfColumns = rsmd.getColumnCount();
Object dbField = null;
out.print ("<td><p align='right'><b>Transaction Reference Number: </b>" + request.getParameter("dsrc_acct") + "<br><b>Transaction Send Date/Time: </b>");
dbField = conRS.getObject(4);
out.print (dbField.toString() + " ");
out.print ("</p></td></table>");
Edited by: jjcheng2 on Oct 26, 2009 2:06 PM

i get this error when i try to compile:
JSPG0049E: /EventListWC.jsp failed to compile : JSPG0091E: An error occurred at line: 114 in the file: /EventListWC.jspJSPG0093E: Generated servlet error from file: /EventListWC.jsp C:\progra~1\IBM\Entity_Resolution\was_ee\profiles\DefaultProfile\temp\DefaultNode\server1\ibm-db2-eas-visualizer\eas-visualizer-client.war\_EventListWC.java:137: cannot resolve symbolsymbol : class SimpleDateFormat location: class com.ibm._jsp._EventListWC SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm:ss"); ^JSPG0091E: An error occurred at line: 114 in the file: /EventListWC.jspJSPG0093E: Generated servlet error from file: /EventListWC.jsp C:\progra~1\IBM\Entity_Resolution\was_ee\profiles\DefaultProfile\temp\DefaultNode\server1\ibm-db2-eas-visualizer\eas-visualizer-client.war\_EventListWC.java:137: cannot resolve symbolsymbol : class SimpleDateFormat location: class com.ibm._jsp._EventListWC SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm:ss"); ^2 errors
Line 114 is when I initialize the SimpeDateFormat.
I m not quite sure what a SQL Injection vulnerability is.

Similar Messages

  • Why jsp is converted into servlet?

    hi,
    Why the jsp is converted into servlet in the container? reason? why cant is evalute as a jsp file itself? why did not they develope a seperate container for jsp?

    hi :-)
    Why the jsp is converted into servlet in the container? reason? why cant is evalute as a jsp file itself?
    JSP is an extension of servlet technology :-)
    why did not they develope a seperate container for jsp?
    Note: (an excerpt from a book)
    "Inside the JSP container is a special servlet called the page compiler.
    The servlet container is configured to forward to this page compiler all HTTP
    requests with URLs that match the .jsp file extension.
    This page compiler turns a servlet container into a JSP container.
    When a .jsp page is first called, the page compiler parses and compiles
    the .jsp page into a servlet class. If the compilation is successful,
    the jsp servlet class is loaded into memory. On subsequent calls,
    the servlet class for that .jsp page is already in memory; however, it could have been updated.
    Therefore, the page compiler servlet will always
    compare the timestamp of the jsp servlet with the jsp page. If the .jsp page
    is more current, recompilation is necessary. With this process, once
    deployed, JSP pages only go through the time-consuming compilation
    process once"
    For more info you can refer to the packages: javax.servlet.jsp and
    javax.servlet.jsp.tagext
    and also the two servlet packages: javax.servlet and javax.servlet.http
    you might be asking why refer to servlet packages? because JSP needs it :-)
    as i mention earlier, JSP is an extension of servlet technology.
    hope other's will also give answer about your question.
    regards,

  • I have a PDF in russian origin how can I convert it correctly?

    I have a PDF in russian origin how can I convert it correctly into MS word?

    Hello,
    which program do you use? For example "ExportPDF" has no Russian language options. Adobe Acrobat however can do it. In this case - if you don't have it at the moment - you should use the 30-day trial >>> see http://www.adobe.com/products/acrobat.html
    Hans-Günter
    P.S.
    A a detailed opinion with another point of view you will find there:
    How can I convert a Russian pdf file, using Adobe Acrobat XI Pro, to a Word document?

  • Converting timestamp with timezone to milisecs

    Hi guys,
    How to converting timestamp with timezone to milisecs?
    I'm using oracle 10g.

    SeánMacGC wrote:
    Hello, do you mean:
    SQL> select to_char(systimestamp, 'SSSSS') from dual;
    TO_CH
    58435
    'SSSSS' Format Model returns 'Seconds past midnight' not milliseconds. I wonder if OP meant Fractional Seconds?
    SQL> SELECT TO_TIMESTAMP_TZ('1999-12-01 11:00:00.00532 -8:00',
      2         'YYYY-MM-DD HH:MI:SS.FF TZH:TZM') col_1 FROM DUAL
      3  /
    COL_1
    01-DEC-99 11.00.00.005320000 AM -08:00
    SQL> SELECT TO_CHAR(col_1, 'FF') fractional_sec FROM
      2  (SELECT TO_TIMESTAMP_TZ('1999-12-01 11:00:00.00532 -8:00',
      3         'YYYY-MM-DD HH:MI:SS.FF TZH:TZM') col_1 FROM DUAL)
      4  /
    FRACTIONA
    005320000
    SQL>Regards,
    Jo
    Edited by: Joice John : Added Code Tags

  • I am having issues converting my word file into a pdf.

    I am having issues converting my word file into a pdf. When I attempt the conversion the pdf download has text boxes overlapping each other. The word file does not have overlapping text boxes. I believe it is the margins of my word file but I am not certain. How can I accurately edit my word file then convert it into a pdf without the overlapping issue occuring?

    Hi,
    Please send me your Word file so that I can look into the issue using below:
    https://adobeformscentral.com/?f=qJiclooYWGGNFtWfj8g3wg
    thank you.
    Hisami

  • When I go to my iTunes Store and download something, for some reason it's not letting me download app it's saying there's a billing issue, when I correct it, it's says contact iTunes/ support can someone please help me, I really want too listen to paying

    When I go to my iTunes Store and download something, for some reason it's not letting me download app it's saying there's a billing issue, when I correct it, it's says contact iTunes/ support can someone please help me, I really want too listen to paying

    You need to do as provided - contact iTunes Store support.
    http://www.apple.com/emea/support/itunes/contact.html

  • Having issues finding my correct t520(4246) display drivers.

    Am having issues finding my correct t520(4246) display drivers....The best l found was Intel graphics 3000...Does it not have a nvidia card
    Moderator Note: Edited subject to match content.
    Solved!
    Go to Solution.

    Hello and welcome,
    For some reason, your model T520 isn't in the tabook   Using the link above "SUPPORT -> Products and Parts Detail -> enter T520 then 4246" the detailed specs page shows Intel HD3000 graphics: Detailed specifications - ThinkPad T520
    So, no nVIdia graphics the way I read it.
    Z.
    The large print: please read the Community Participation Rules before posting. Include as much information as possible: model, machine type, operating system, and a descriptive subject line. Do not include personal information: serial number, telephone number, email address, etc.  The fine print: I do not work for, nor do I speak for Lenovo. Unsolicited private messages will be ignored. ... GeezBlog
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • How to ensure JSP files are syntactically correct before deployment?

    Hi All,
    Is there a way to ensure the JSP files are syntactically correct before
    deploying them to the server (iAS)? Where can I find the details for the
    errors so as to resolve them? Please advise.
    Christopher Lam

    You can precompile them before deploying.
    Use jspc.bat from \iplanet\ias6\ias\bin.
    There could be a bug in this script. I had to fix something for myself. Check the parts containing 'tomcat'

  • Remote enabled FunctionModule to convert Timestamps

    Hello,
    I need your help. I am searching for an SAP-FunctionModule that convert Timestamps from UTC to other time zones. The FunctionModule should be remote enabled and SAP standard (similar to FunctionModule = “TZ_GLOBAL_TO_LOCAL”).
    Perhaps you can help me.

    Hi Sam,
    thank you very much for your answer. But we don´t like to build up a custom Z-function. We need a SAP-Standard remote enabled functionality (BAPI or Function).
    I there really no standard functionality.
    Holger

  • JSP that converts office extensions to pdf and then upload them

    Hi there !
    Im trying to convert office extensions ( .xls, .ppt, etc) to pdf and then upload the resulting file to a server .
    currectly im using the upload solution posted by the user anna_DRA here : http://forums.sun.com/thread.jspa?threadID=672874
    and as for the conversion im using a solution which uses OpenOffice's lib to do the conversion.I'm going to post the codes of my JSP and my HTML ( which just contains the form to get the file to be converted and uploaded).
    observation: the point which is giving me headaches is how to get the file sent by my form, convert it into a File object, use my conversion tool and then deliver it to my upload tool so it can be stored.... i cant seem to get the File object from the request object ( tried getattribute and it returns null....) .
    observation':I do know about and how to use MVC but my boss asked me to make this work with just one JSP or a JSP and a HTML.
    index.html :
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Upload test</title>
    </head>
    <body>
    <form enctype="multipart/form-data" action="/WSPdfConversion1.1/Conversion.jsp" method=POST>
    <input type="file" name = "FileUp">
    <input type="submit" value="Enviar"/>
    </form>
    </body>
    </html>Conversion.jsp :
    upload portion:
    MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
    OpenOfficeConnection OpenOfficeConnection = new SocketOpenOfficeConnection(8100);
    String newName = "";
    Hashtable files = mrequest.getFiles();
    UploadFile file = (UploadFile) files.get("FileUp");//Give name u r given in the previous page.
    String fileName = file.getFileName();
    upBean.store(mrequest, "FileUp");conversion portion:
    OpenOfficeConnection OpenOfficeConnection = new SocketOpenOfficeConnection(8100);
    try {
        OpenOfficeConnection.connect();
    } catch (ConnectException e) {
        e.printStackTrace();
    File inputFile = new File("C:\\Users\\thiago\\Documents\\"+fileName);
    for(int i = 0; i <= fileName.length() - 4; i++){
        String s = ""+fileName.charAt(i);
        newName = newName.concat(s);
    File outputFile = new File("C:\\Users\\thiago\\Documents\\"+newName+".pdf");
    //convert the spreadsheet
    DocumentConverter ExcelToPDFConverter = new OpenOfficeDocumentConverter(OpenOfficeConnection);
    ExcelToPDFConverter.convert(inputFile, outputFile);
    OpenOfficeConnection.disconnect();Both work just ok when separated but i cant get both to work together....
    Any help is much appreciated!!!
    Thanks in advance
    Edited by: thiagocbalducci on Mar 24, 2010 12:07 PM
    Edited by: thiagocbalducci on Mar 24, 2010 12:09 PM

    Hello TSN,
    Test Screen Name wrote:
    Picking just one point: PDF -> EPS -> PDF. This could not possibly do more than one page, because EPS is absolutely by definition a single page format. Therefore you must choose a page when exporting PDF to EPS.
    Thanks for your response.
    I was thinking Microsoft... which has allowed multi-page eps files for years. But you're correct, this is normally an unsupported .eps format.
    I solved the problem over the weekend by doing the following:
    1) I removed the suspect OTF font family but despite doing so, the folder still had two 'corrupted' but unused copies of an italic font. They refused to remove so I had to boot into Win7 SAFE mode to remove.
    2) After complete removal of the OTF font family. I reinstalled the OTF font *BUT* only from a different repository (oddly, this other OTF font set is slightly larger per font).
    3) Once installed, I tested with Flare, published and uploaded to Crocodoc SUCCESSFULLY. Yeah!
    I don't have anymore time to test but the questions remain, such as, was it one or more of the following issues:
    a) Flare has a problem handling some OTF fonts or cannot error correct (the way other programs do) for marginal fonts or font errors?
    b) Was it the two corrupted fonts in the Windows/fonts folder?
    c) Was it the slightly different OTF fonts that I am no longer using?
    Take care

  • Convert timestamp from text file (hh:mm:ss) into seconds

    How can I import a column of time stamps from a text file of the form hh:mm:ss and convert it into seconds using LabView? For example, 13:30:30 into 48630.
    Also, using the "Read from Spreadsheet File VI" I can't seem to get the entire time stamp imported correctly. Only the value before the colon is read. For example, if the timestamp reads 13:30:30, only 13 is inputed into the array in LabView.
    FYI I'm using LabView 7. Thanks!

    Here's a LV 7 example. Just a Scan From String, a couple of Multiply functions and add the results. As far as your Read From Spreadsheet issue, by default, the function creates an array of SGLs. 13:30:30 is text and the functions needs to be modified to return an array of strings. There are instructions on the diagram on how to do this. When you've made the changes, save it as a new name and in a new location.
    Attachments:
    time_to_seconds.vi ‏17 KB

  • Internationalization  issue : convert date/time to GMT/UTC

    We have our webservices running in websphere /oracle.There is this requirement to internationalize the application ...like
    a) language .....
    d)Internatiolization of time :
    For this requirment I am planning to do the following.Service request with date will be converted to GMT before it is stored in database and the response back will be converted from GMT back to the time zone of the requester and have the application server/database server configured to UTC time.Is this a good strategy or is there a better one.
    Thanks
    m

    Manjit wrote:
    Sabre,to confirm again...you are suggesting that there is even no need to change the oracle Date field from Date type to Timestamp.The only thing I really have to do is for display purpose convert/format the response date to the zone the request is coming from.Please let me know if I missed anything.The above statement is indefinite.
    Are you starting with a java.util.Date or perhaps a java.sql.Timestamp?
    Then you do NOT convert them. You display them. You use SimpleDateFormat for that. You do not concern yourself at all with timezones exception in terms of creating a SimpleDateFormat. And that is ONLY an issue if you are creating the string (display value) on a server. If you are doing that you will need the client to provide you with a timezone. There is no magic way to get that from the client. If a client app is doing the display the the client is running in a client VM and that VM will already have a display format that might be suitable.
    Conversely if you are receiving a timestamp value as a text value (say read it from a file) then you must convert that into a java.util.Date. You do that via SimpleDateFormat. The specifics of how you do that depends on the form of the text value.

  • Issues converting my h264 footage to AppleProRes 4442HQ

    Hello everyone, I shot an interview with 2 HDMI lights an Actor and black background. I was very picky about setting the right color temperature in Kelvin degrees with a Sekonic color meter, I also adjusted the Canon 7D settings to make the recording less saturated and less contrasty in the picture style menu. Moreover, I checked everything during the shoot on a calibrated 24 inch monitor that I was using as big viewfinder trough the HDMI connection. Now that I need to convert every clip from H264 to AppleProRes 442 HQ for editing purpose I noticed that my final converted mov file is very different from what I shot. Let me explain, the black background was having a kind of pattern/texture that disappeared, the image is much more contrasty, the skin tone of the talent changed and overall everything is more dark. The only settings that I touched were: no sound, size 1920X1080 HD, 24 fps. Does anybody know if the check box on Automatic Gamma should be disabled? I kept it on Automatic as it is by default. There is a template of settings that I should use in this delicate phase? Thank you very much for your appreciated help.

    rumblemac wrote:
    As a monitor during production I used an HP Dreamcolorzx.
    A computer display, not a standard NTSC broadcast quality monitor. It does claim to reproduce the full NTSC color gamut, but that does not necessarily make it broadcast quality. I'll wait for someone to chime in on that.
    Right now I'm just using my apple laptop's 17 display (matte).
    You should really check it on an external NTSC monitor before spending too much more time.
    My MacBook Pro is not calibrated however when I play the two clips in QuickTime the h264 mov file is closer to what I shot, whereas the apple pro res one is like 2 stops darker and very saturated.
    It's not recommended, but you can import the h.264 into FCP to compare the two files in FCP. Have you looked at them in FCP yet?
    I chose to save as appleprores 442HQ and I understood why should not do it again, but that besides making the file heavier is not related to the main Issue that everything is darker with default settings.
    Probably correct.
    Once again, how was the HP Dreamcolorz monitor calibrated on set?
    Once again, how did you convert the files to ProRes?

  • Issue converting PMS to CMYK

    I'm using Illustrator CS5 / Mac OS 10.6.8
    Ihave a customer supplied file that has several placed grayscale .tif images in it. The images are colored with a spot PMS color. We are going to run the job CMYK. So I go into my swatches palette, select the spot color, and change it from Book Color to CMYK, and then from Spot Color to Process Color. When I do, the image turns black. If you click on it it still has the correct color applied to it. It's just black instead of the color it's supposed to be.
    I've tried just clicking on the image, going to the color palette and converting it to CMYK there. Same result. I've tried changing it to a different color. It still stays black but when you click on it it says it's whatever color it's supposed to be.
    I've also tried converting the color to LAB and RGB just to see if that made any difference. The grayscale still turns black.
    Tried printing it, figuring it's just a weird display issue, but it prints black as well.
    This only effects grayscale images. If I create a vector shape of the PMS color and then change the color to CMYK it works as it should.
    I'm stumped. Never seen this before. Anyone have any ideas?

    It is in CMYK mode. The blending mode is 100% and Normal. It was originally a CS5 document.
    The color change is big. The color is PMS 583. I also tried copying the image and putting it into a brand new document. Same issue.
    Here is a screen shot with the grasycale image with a spot PMS applied - it's the box with the "OUR NO LIST" in it.
    Here it is when I change the color from PMS to CMYK:
    Notice it's still selected, and the color applied to it says it's a CMYK color, but it's black.

  • Page numbering/imbedded font issue ~ converting from Word 2003?

    I am new to this forum, so please forgive me if this issue has been addressed 100 times already!
    I am preparing a novel for publication through Createspace (Amazon). Their requirements include that the fonts all be imbedded, and that page numbering begins with '1' on the first page of the story. When I convert my properly numbered word 2003 file to pdf, it comes out looking great, but the page numbers begin with 5 on first page of the story. So I have 2 questions:
    If the pages look okay in terms of font, does that mean that my fonts are correctly imbedded in the pdf?
    and
    Is there a way for me to control the page numbering so it begins with 1 on the first story page?
    Thanks in advance!

    I'm terribly sorry for the trouble. We are working to address the problem with page numbers in an upcoming release, but for now I recommend you try the conversion again using Adobe Acrobat desktop software. You could download a free 30 day trial if needed here:
    http://www.adobe.com/products/acrobatpro/tryout.html
    Kind Regards,
    Michelle

Maybe you are looking for

  • Error occuring while creating a Delivery for Stock transport order

    Hi, I am getting error while creating the delivery for thr stock transport order.The error message is given below.                                                                                 Error Log for coll. run 0001248218                     

  • Problem in committing a new document in third party repository through Ente

    Hi all, I am trying to create a document in third party repository through enterprise portal GUI. The steps I am following are:      1. I go to repository integrated with the Enterprise portal.      2. Then go to Folder -> New -> HTML File.      3. H

  • Why do my videos look too narrow when I upload to youtube

    I have tried uploading to youtube in mp4 .mov and avi files, but the video always looks a little narrow with black space eiter side of the video. It also looks slightly stretched. What am I doing wrong?

  • Message prompt in oracle form trigger

    Hi all, i'm using oracle form builder here i put button call 'INSERT' and when i pres this button records are insert into table and message want to prompt. if there is alredy records in table then error message want prompt. here i'm usin this trigger

  • Simple Applet not running in ie 5

    Hi I have built a simple applet consisting of 4 classes, The button panel, and three listener classes. When I run this from the command line it works fine, and presents me with a grey panel (100 * 180) and the three buttons are drawn onto the applet