Parse Timestamp

Somebody help me, how can i consert Date to Timestamp. i want to parse
the Timestamp. but the parse method only return Date.
Please help.
best regards
Nau

When formatting Dates in java I've usually used the java.text.SimpleDateFormat class which gives a lot of flexiblitity in choosing your format. You may want to refer to the java.util.Calendar object also. Note that Date formats are not synchronized.
Here's a simple program that prints the current time in two formats:
package example;
import java.util.Date;
import java.text.SimpleDateFormat;
* @author pete
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
public class WhosGotTheTime {
     public static void main(String[] args) {
          // initially display hour:minute:second AM/PM
          SimpleDateFormat formatter =
new SimpleDateFormat("h:mm:ss a");
          Date now = new Date();
          System.out.println("At the tone, the time is "
          + formatter.format(now)
+ "\n...tone");
          // modify to display hour:minute:second:millisecond
          // AM/PM and General Time Zone
formatter.applyPattern("h:mm:ss.S a zzzz");
          System.out.println("\nAt the tone, the time is "
          + formatter.format(now)
+ "\n...tone");

Similar Messages

  • How to parse timestamp data

    Hi,
    I am not able to parse timestamp data. I am bringing this timestamp from AD through LDAP attribute through java code. I want date and time from this timestamp so that I can compare it with another date and time and get the difference between the two.
    If anybody knows the solution for this then please let me know.
    Thanks,
    Kalpana.

    Hi Kalpana,
    try this to convert AD date to java date format
         final long FILETIME_EPOCH_DIFF = 0xa9735dcc400L;
         final long HUNDRED_NANO_PER_MILLI_RATIO = 10000L;
         long activeDirDate = 129476773898586231L;
         long l1 = activeDirDate / 10000L;
         long l2 = l1 - FILETIME_EPOCH_DIFF;
         Date newdate = new Date(l2);
         System.out.println("AD Date is in Java Date format : "+newdate);
    Thanks,
    Pallavi

  • Parse Timestamp with source code

    Somebody help me, how can i convert Date to Timestamp. i want to parse
    the Timestamp. but the parse method only return Date.
    Please help.
    Here are the source code
    Date mydate;
    String myString;
    Timestamp myTime = new Timestamp(mydate.getTime());
    myString = DateFormat.getDateTimeInstance().format(myTime);
    try {
    DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT,Locale.US);
    myTime = df.parse(myString);
    catch (ParseException e) {}
    best regards
    Nau

    I little chnage your example
    String myString;
    java.util.Date mydate = new java.util.Date();
    Timestamp myTime = new Timestamp(mydate.getTime());
    System.out.println("before " + myTime);
    myString = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.FULL, Locale.US).format(myTime);
    try {
    DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.FULL, Locale.US);
    myTime.setTime(df.parse(myString).getTime());
    System.out.println("after " + myTime);
    } catch (ParseException e) {
    e.printStackTrace();
    or yous form
    String myString;
    java.util.Date mydate = new java.util.Date();
    Timestamp myTime = new Timestamp(mydate.getTime());
    System.out.println("before " + myTime);
    myString = myTime.toString();
    myTime = Timestamp.valueOf(myString);
    System.out.println("after " + myTime);

  • Verify which  parsed timestamp folder is closer to the current timestamp

    Hi,
    I have "n" number of timestamps in a folder like :-
    2010_08_04_15_14_57 (yyyy_dd_mm_h_mm_ss)
    2010_08_04_15_15_57
    2010_08_04_15_16_57
    From these folders I need to pickup the latest(recent) timestamp folder, here it is 2010_08_04_15_16_57. For this to happen I need to check if any of these timestamp folders is close to the current timestamp, so that i can make sure that particular folder is the recently created one? How to find that whether the timestamp folder is close to the current Timestamp, because Calendar & Date classes have the before() & after(), but there is no API to find which of these timstamp folders are close to the Current timestamp? Please shed some light into this.
    Thanks in advance.

    AnanthJava wrote:
    Hi,
    I have "n" number of timestamps in a folder like :-
    2010_08_04_15_14_57 (yyyy_dd_mm_h_mm_ss)
    2010_08_04_15_15_57
    2010_08_04_15_16_57
    From these folders I need to pickup the latest(recent) timestamp folder, here it is 2010_08_04_15_16_57. For this to happen I need to check if any of these timestamp folders is close to the current timestamp, so that i can make sure that particular folder is the recently created one? How to find that whether the timestamp folder is close to the current Timestamp, because Calendar & Date classes have the before() & after(), but there is no API to find which of these timstamp folders are close to the Current timestamp? Please shed some light into this.
    Thanks in advance.If there are no other type of files or folders in the the folder containing these time stamp folders then you can use File.listFiles() and use Arrays.sort() on them to give the most recent time stamp folder in the last element. If there are other types of folder and files, then it would be necessary to implement FileFilter and use File.listFiles(FileFilter). The advantage is you have a File reference to the time stamp folder you presumably ultimately need.
    Edited by: pete_d on Aug 4, 2010 9:41 AM
    how strange. I was replying when it got moved.

  • TimeStamp application with OSDT.

    Hi.
    I've tried to make a TimeStamp application with OSDT libraries (osdt_cert.jar, osdt_cmp.jar, osdt_cms.jar, osdt_core.jar, osdt_tsp.jar). I can get timeStamp information like TSA, SerialNumber, etc, but I've a problem when try to save TimeStamp in a file.
    When I try to parse TimeStamp with:
    openssl asn1parse -inform DER -in ./sello.tsr
    I get this error:
    Error in encoding
    *139851320858280:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:150:*
    Source is:
    resumen = MessageDigest.getInstance(ALGORITHM);
    resumen.update(datos);
    byte [] hash = resumen.digest();
    MessageImprint messageImprint =  new MessageImprint(AlgID.sha1, hash, false);
    TSPTimeStampReq peticion = new TSPTimeStampReq(messageImprint);
    peticion.setCertReq(true);
    URL url = new URL(TSA_URL);
    System.out.println("Abriendo conexión a " url);+
    HttpURLConnection conexion = (HttpURLConnection)url.openConnection();
    System.out.println("Enviando peticion...");
    TSPTimeStampResp respuesta = HttpTSPRequest.getResponse(peticion, conexion);
    System.out.println("Respuesta recibida");
    +// Contiene el sello+
    CMSSignedDataContentInfo timeStampToken = respuesta.getTimeStampToken();*
    +// La informacion esta en TSTInfo y no en el TimeStampToken+
    TSTInfo tstInfo = respuesta.getTSTInfo();*
    +// Serializamos el objeto para poder pasarlo a fichero+
    ByteArrayOutputStream bs= new ByteArrayOutputStream();*
    ObjectOutputStream os = new ObjectOutputStream (bs);*
    respuesta.output(os);*
    os.close();*
    byte[] sello =  bs.toByteArray(); // devuelve byte[]*
    FileOutputStream fileOutput;*
    fileOutput = new FileOutputStream (args[1]);*
    BufferedOutputStream bufferedOutput = new BufferedOutputStream(fileOutput);*
    bufferedOutput.write(sello);*
    bufferedOutput.close();*
    I think the problem is at bold source.
    I develop the same application with BouncyCastle libraries and works well, but i want to learn OSDT.
    Can anyone help me? How can I safe TimeStamp?
    Thanks and best regards.

    I should note that this only occurs on certain windows machines. I am still waiting to hear which ones.
    I personally do not experience this so I have to rely on Client feedback.
    On my machine it works fine without Flash installed.

  • Working with ZULU timestamps.

    I have this simple code:
    String timestamp = "20050723165000Z-0500";
              SimpleDateFormat fmtTimestamp = new SimpleDateFormat("yyyyMMddHHmmss'Z'");
              int start = timestamp.lastIndexOf("Z") + 1;
              int end = timestamp.length();
              String offset = timestamp.substring(start, end);
              Date deliveryDate = fmtTimestamp.parse(timestamp);
              System.out.println(deliveryDate);
              DateFormat outputFormat = new SimpleDateFormat("yyyyMMddHHmmssS");
              TimeZone timezone1 = TimeZone.getTimeZone(offset);
              outputFormat.setTimeZone(timezone1);
              System.out.println(outputFormat.format(deliveryDate));
    It prints this: 200507232150000
    I need it to print this: 200507231150000
    What am I doing wrong?

    Is this an earlier post of yours: http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=33&t=015971
    You seem to be confused with + and - ZULU time.
    The timestamp you give: 20050723165000Z-0500 is 5 hours before GMT,
    ie, depending on daylight savings time, on the eastern side of
    North America for example. I assume you want to convert this to
    the time at GMT (It would be nice to have you admit to that). Clearly,
    this will be +5 hours, not -4 hours. How are you arrive at your times?
    Code:
    String timestamp = "20050723165000Z-0500";
    SimpleDateFormat fmtTimestamp = new SimpleDateFormat("yyyyMMddHHmmss'Z'Z");
    Date deliveryDate = fmtTimestamp.parse(timestamp);
    DateFormat outputFormat = new SimpleDateFormat("yyyyMMddHHmmssS");
    TimeZone timezone = TimeZone.getTimeZone("GMT+0");
    outputFormat.setTimeZone(timezone);
    System.out.println(outputFormat.format(deliveryDate));

  • Calender error

       String timestamp = parseEventTimeId(reader);
                   try {
                        Date eventtime = timeFormatStored.parse(timestamp);
                        Calendar startthis = eventtime.getTime();
                        event.setTimeStamp(startthis);
                    } catch (ParseException ex) {
                        LOG.error(ex);
                    }throws error :
    cannot convert long to calender
    please an u give me suggestion.
    thanks

    thanks for that i rote a new method
    public static Calendar StringCalendar(String timestamp) throws ParseException {
            Calendar cal=Calendar.getInstance();
            DateFormat timeFormatStored = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
            Date eventtime = timeFormatStored.parse(timestamp);
            cal.setTime(eventtime);
            return cal;
        private static DeviceEvent parseEvent(XMLStreamReader reader, DeviceEvent event, Device device,
                DateFormat timeFormatStored) throws XMLStreamException, MalformedSigmaXMLException {
            while (reader.hasNext()) {
                if (reader.getEventType() == XMLStreamConstants.START_ELEMENT
                        && "seqNo".equals(reader.getLocalName())) {
                    event.setEventID(parseEventId(event, reader));
                } else if (reader.getEventType() == XMLStreamConstants.START_ELEMENT
                        && "eventTime".equals(reader.getLocalName())) {
                    String timestamp = parseEventTimeId(reader);
                    try {
                        Calendar eventParser= SigmaXMLEventParser.StringCalendar(timestamp);
                       Calendar eventtime = eventParser.parse(timestamp);
                        System.out.println("time"+eventParser);
                        event.setTimeStamp(eventParser);
                    } catch (ParseException ex) {
                        LOG.error(ex);
                 reader.next();
            throw new MalformedSigmaXMLException("expected closing <deviceEvent>");
        public static String parseNextEventTime(XMLStreamReader reader) throws XMLStreamException,
                MalformedSigmaXMLException {
            while (reader.hasNext()) {
                if (reader.getEventType() == XMLStreamConstants.START_ELEMENT
                        && "eventTime".equals(reader.getLocalName())) {
                    return parseEventTimeId(reader);
                reader.next();
            throw new MalformedSigmaXMLException("missing Device event Event Time");
        }throws exception as
    java.lang.Error: Unresolved compilation problem:
         The method parse(String) is undefined for the type Calendar
         at com.gehc.device.sigma.SigmaXMLEventParser.parseEvent(SigmaXMLEventParser.java:85)
         at com.gehc.device.sigma.SigmaXMLEventParser.parseNextEvent(SigmaXMLEventParser.java:58)
         at com.gehc.device.sigma.SigmaXMLEventParserTest.assertThrowOnNextEvent(SigmaXMLEventParserTest.java:76)
         at com.gehc.device.sigma.SigmaXMLEventParserTest.testParseMessageWithoutID(SigmaXMLEventParserTest.java:29)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

  • Reading an ebXML message from a JAXMServlet

    I have the following servlet in Tomcat 4.1.18, using the contents of java_xml_pack-summer02_01:
    public class Consume extends JAXMServlet implements OnewayListener
    private ProviderConnectionFactory pcf;
    private ProviderConnection pc;
    private static final String providerURI = "http://java.sun.com/xml/jaxm/provider";
    //private MessageFactory messageFactory;
    public void init(ServletConfig servletConfig) throws ServletException
    super.init(servletConfig);
    try
    pcf = ProviderConnectionFactory.newInstance();
    pc = pcf.createConnection();
    setMessageFactory(new EbXMLMessageFactoryImpl());
    catch (Exception e)
    e.printStackTrace();
    throw new ServletException("Couldn't initialize " + this.getClass().getName() + " servlet: " + e.getMessage());
    public void onMessage(SOAPMessage message)
    EbXMLMessageImpl ebXML = null;
    try
    System.out.println("== messagetype=" + message.getClass().getName());
    System.out.println("== constructing EbXMLMessage");
    ebXML = (EbXMLMessageImpl)message;
    System.out.println("== got EbXMLMessage " + ebXML.toString());
    catch(Exception e)
    System.out.println("== Couldn't create ebXML message from SOAP message: " + e);
    if(ebXML!=null)
    System.out.println("EbXML: From " + ebXML.getFrom().toString());
    System.out.println("EbXML: To " + ebXML.getTo().toString());
    System.out.println("EbXML: Sender " + ebXML.getSender().toString());
    System.out.println("EbXML: Receiver " + ebXML.getReceiver().toString());
    System.out.println("EbXML: CPAId " + ebXML.getCPAId());
    System.out.println("EbXML: Conversation " + ebXML.getConversationId());
    System.out.println("EbXML: Action " + ebXML.getAction());
    System.out.println("EbXML: MessageId " + ebXML.getMessageId());
    Manifest manifest = ebXML.getManifest();
    Reference[] refs = manifest.getReferences();
    for(int i=0; i<refs.length; i++)
    System.out.println("EbXML ref " + refs.getId() + ": " + refs[i].getDescription());
    ...etc
    However, after the "ebXML = (EbXMLMessageImpl)message;" line, all of the ebXML.get*() calls return null. If I use "ebXML = new EbXMLMessageImpl(message);", I get the same null results.
    I can continue on successfully deal with the SOAPMessage, but how do I correctly interpret the SOAPMessage as an EbXMLMessageImpl?
    Thanks.
    PJDM

    After investigating this, the problem seems to be that com.sun.xml.messaging.jaxm.ebxml.EbXMLMessageImpl is using the namespace
    NS_URI = "http://www.ebxml.org/namespaces/messageHeader";
    instead of
    NS_URI = "http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd";
    Subsequently, the same class attempts to parse timeStamp as a long, instead of an ISO8601 string.

  • Error in KPI Monitoring Screen

    Hi All,
    I am new to KPI Monitoring. Is that any example I can get for configuring it.
    I follwed this docment "http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1061e1c5-e25b-3010-aaae-bca7eb47837e?overridelayout=t…"
    I tried with pointing normal Tag query into the "BaseKPI". And tried to run from the KPI monitoring screen. But it throws error as below.
    Unable to run selected search template for the KPI MII_Samples/MIIOBJ/BaseKPI
    [EXCEPTION]
    com.sap.xmii.kpi.core.KPIMonitorRuntimeException: Unable to parse timestamp value for property DateTime at index 1 with format MM/dd/yyyy HH:mm:ss
    at com.sap.xmii.Illuminator.templates.DBQuery.setParameter(DBQuery.java:855)
    at com.sap.xmii.Illuminator.templates.DBQuery.prepareStatement(DBQuery.java:634)
    at com.sap.xmii.Illuminator.templates.DBQuery.executeQuery(DBQuery.java:281)
    at com.sap.xmii.kpi.core.KPIMonitorManager.queryKPIValue(KPIMonitorManager.java:762)
    at com.sap.xmii.kpi.core.KPIMonitorManager.populateDynamicDetails(KPIMonitorManager.java:602)
    at com.sap.xmii.kpi.core.KPIMonitorManager.runSearchTemplate(KPIMonitorManager.java:347)
    at com.sap.xmii.ejb.alerts.KPIMonitorBean.runSearchTemplate(KPIMonitorBean.java:206)
    at sun.reflect.GeneratedMethodAccessor446.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext$InvocationContextImpl.proceed(AbstractInvocationContext.java:131)
    at com.sap.xmii.ejb.common.AdministrationInterceptor.wrapRuntimeExceptions(AdministrationInterceptor.java:50)
    at com.sap.xmii.ejb.common.AdministrationInterceptor.assertHasPermission(AdministrationInterceptor.java:38)
    at sun.reflect.GeneratedMethodAccessor371.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Application.invoke(Interceptors_Application.java:53)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:50)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:37)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:21)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_MethodRetry.invoke(Interceptors_MethodRetry.java:46)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
    at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164)
    at com.sun.proxy.$Proxy658.runSearchTemplate(Unknown Source)
    at com.sap.xapps.xmii.ui.admin.alert.wd.comp.kpimonitor.KPIMonitor.populateMasterKPINode(KPIMonitor.java:822)
    at com.sap.xapps.xmii.ui.admin.alert.wd.comp.kpimonitor.wdp.InternalKPIMonitor.populateMasterKPINode(InternalKPIMonitor.java:423)
    at com.sap.xapps.xmii.ui.admin.alert.wd.comp.kpimonitor.KPIMonitorView.onActionRunTemplate(KPIMonitorView.java:918)
    at com.sap.xapps.xmii.ui.admin.alert.wd.comp.kpimonitor.wdp.InternalKPIMonitorView.wdInvokeEventHandler(InternalKPIMonitorView.java:800)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:142)
    at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:75)
    at com.sap.tc.webdynpro.clientserver.phases.ProcessingEventPhase.doHandleActionEvent(ProcessingEventPhase.java:159)
    at com.sap.tc.webdynpro.clientserver.phases.ProcessingEventPhase.execute(ProcessingEventPhase.java:94)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequestPartly(WindowPhaseModel.java:162)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doProcessRequest(WindowPhaseModel.java:110)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:97)
    at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:515)
    at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:58)
    at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doExecute(ClientApplication.java:1671)
    at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doProcessing(ClientApplication.java:1485)
    at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doApplicationProcessingStandalone(ApplicationSession.java:908)
    at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doApplicationProcessing(ApplicationSession.java:880)
    at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:357)
    at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:326)
    at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doContent(AbstractDispatcherServlet.java:87)
    at com.sap.tc.webdynpro.serverimpl.wdc.DispatcherServlet.doContent(DispatcherServlet.java:89)
    at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doPost(AbstractDispatcherServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)
    at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:373)
    at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:499)
    at com.sap.tc.webdynpro.serverimpl.wdc.ForwardServlet.doPost(ForwardServlet.java:77)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)
    at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:38)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:466)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:210)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:441)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:430)
    at com.sap.engine.services.servlets_jsp.filters.DSRWebContainerFilter.process(DSRWebContainerFilter.java:38)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:81)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:278)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:81)
    at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
    at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.SessionSizeFilter.process(SessionSizeFilter.java:26)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.MemoryStatisticFilter.process(MemoryStatisticFilter.java:57)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.DSRHttpFilter.process(DSRHttpFilter.java:43)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:475)
    at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.process(Processor.java:269)
    at com.sap.engine.services.httpserver.server.rcm.RequestProcessorThread.run(RequestProcessorThread.java:56)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)
    at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)
    Can any one tell me where I can get the simple example?
    Regards
    R.Prakash

    Hi Ria,
    As I already said :
    I follwed this docment "http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1061e1c5-e25b-3010-aaae-bca7eb47837e?overridelayout=t…
    This is the same document. The problem is I am getting the error while pointing a simple tag query in "BaseKPI". Is their anything like demo kit for KPI Monitoring like "SAP_BM". Please let me know?
    Regards
    R.P"

  • Query improvement

    Hello
    I have this query with an high estimated cost. The index seems correct .
    I think the problem could be the order by.
    How can i improve the performances of this query?
    thanks
    Nicola
    SELECT
      "MANDT" , "MESTYPE" , "CPIDENT" , "PROCESS" , "TABNAME" , "TABKEY" , "FLDNAME" , "CRETIME" ,
      "ACTTIME" , "USRNAME" , "CDOBJCL" , "CDOBJID" , "CDCHGNO" , "CDCHGID"
    FROM
      "BDCP2"
    WHERE
      "MANDT" = :A0 AND "MESTYPE" = :A1 AND "PROCESS" = :A2
    ORDER BY
      "MANDT" , "CPIDENT"#
    Execution Plan
    Explain from v$sql_plan: Address: 0000000417A7B140 Hash_value:  4212140235 Child_number:  0 Sql_id: 287w0agxj0a6b
    Parse Timestamp: 20110216   11:23:47
    SELECT STATEMENT ( Estimated Costs = 32.486 , Estimated #Rows = 0 )
            3 SORT ORDER BY
              ( Estim. Costs = 32.486 , Estim. #Rows = 372.147 )
              Estim. CPU-Costs = 694.565.717 Estim. IO-Costs = 32.383
                2 TABLE ACCESS BY INDEX ROWID BDCP2
                  ( Estim. Costs = 23.271 , Estim. #Rows = 372.147 )
                  Estim. CPU-Costs = 210.335.152 Estim. IO-Costs = 23.240
                    1 INDEX RANGE SCAN BDCP2~001
                      ( Estim. Costs = 1.334 , Estim. #Rows = 372.147 )
                      Search Columns: 3
                      Estim. CPU-Costs = 24.173.204 Estim. IO-Costs = 1.330
                      Access Predicates
    Last statistics date                  27.01.2011
    Analyze Method               Sample 357.261 Rows
    Number of rows                        35.726.100
    Number of blocks allocated               662.674
    Number of empty blocks                       240
    Average space                                913
    Chain count                                    0
    Average row length                           126
    Partitioned                                   NO
    index 0
    MANDT                                          1
    MESTYPE                                       48
    CPIDENT                               11.392.466
    index 001
    MANDT                                          1
    MESTYPE                                       48
    PROCESS                                        2
    CRETIME                                   57.406
    CPIDENT                               11.392.466

    Hi,
    The query is already as good as it gets, though you might want to remove the ORDER BY and instead SORT in abap.
    If the statistics are correct your BDCP2 table is too big (35 million entries!), and that's where your problem lies.
    Make sure you keep it small by cleaning regularly with transaction BD22 / report RBDCPCLR.
    Regards,
    Rui Dantas

  • Java code vs database query performance  ?????

    Hi to all forum Members,
    I am quite new in this forum, if i am at wrong place to post the query, please direct me to right place.
    Question background : I want to have date in dd.MM.yyyy format in my excel sheets. Therefore, i have two possibilities
    1- either to parse date from timestamp ( loaded column values from database ) in java
    2 - or write a query in such a way which cast timestamp as date e.g.
    select *, DATE_FORMAT(cast( inserted_timestamp as date), '%d.%m.%Y') as inserted_date from link where id > 290002;
    Question: i like to know which method is better in terms of performance ? Because , in my first internship , i have been always desired to get the most of job done from database instead of one's application code.
    Thanks in advance.
    Regards,
    Romi

    Hi Mr / Miss tjacobs01,
    Thanks for reply. I had alread knowledge that timestamp is subclass of date. Firstly, I wanted to know how far my x-colleague's statement is authentic.
    I am completely agree with your statement
    " Doing as much as you can in java / application layer makes scaling + testing SO MUCH EASIER"
    So far i am performing convertion related manipulation in java classes. But i am facing some kind of java heap problem, as long as i insert data into xls sheet coz my fetched dataset contains more than 50K rows. Therefore i thought perhaps i can spare lil bit heap space. And i dont think i should let the my own java class handle larger dataset. What i want to say perhaps i can not as a single developer can achieve, with little experience, as much performance as i can achieve from database which is designed by many profis. that is why i am in favor of database query instead of cracking and parsing timestamp into date. If i am getting a ready made solution which is optimized then why should i try to reinvent the wheel again at application level.
    I think now, reply to first question truly force me to ask heap related problem. But i am thinking its not good idea to ask related question in this post.
    By the way : second question is : how can i insert dataset more than 50K rows into xls sheet. So far i know two methods
    1 - extend java heap size on both JRE and Tomcat
    2- use streams to continously transfer the data.
    About 2nd method, i never used and dont know whether it is a better choice.
    If you think you do not like to answer 2nd question in this post then please click on following link.
    Kind Regards,
    Romi

  • Shared cursos cache

    Hi Oracle gurus. i'm have question about Shared cursos cache  in one of BI server's i'm see very big
    buffer gets
    the statment are :
    SELECT
      file#
    FROM
      file$
    WHERE
      ts#=:1
    Explain shows
    SELECT STATEMENT ( Estimated Costs = 2 , Estimated #Rows = 0 )
            2 TABLE ACCESS BY INDEX ROWID FILE$
              ( Estim. Costs = 2 , Estim. #Rows = 16 )
              Estim. CPU-Costs = 14.443 Estim. IO-Costs = 2
                1 INDEX RANGE SCAN I_FILE2
                  ( Estim. Costs = 1 , Estim. #Rows = 1 )
                  Search Columns: 1
                  Estim. CPU-Costs = 7.321 Estim. IO-Costs = 1
                  Access Predicates
    User SYS
    What can you advise? Regards.

    Hello Sergo,
    i have cross checked your information with our productive BW system.
    Here are the information / statistics of the same SQL on our BW system:
    Parse Timestamp: 20100328 14:30:44
    System: <SID>
    SQL_ID  bsa0wjtftg3uw, child number 0
    select file# from file$ where ts#=:1
    Plan hash value: 690176192
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |         |       |       |     2 (100)|          |
    |   1 |  TABLE ACCESS BY INDEX ROWID| FILE$   |    32 |   224 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | I_FILE2 |     1 |       |     1   (0)| 00:00:01 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1 / FILE$@SEL$1
       2 - SEL$1 / FILE$@SEL$1
    Predicate Information (identified by operation id):
       2 - access("TS#"=:1)
    Column Projection Information (identified by operation id):
       1 - "FILE#"[NUMBER,22]
       2 - "FILE$".ROWID[ROWID,10]
    Executions: 1.164.157
    Buffer Gets: 466.953.357
    Buffer Gets per Execution: 401,1
    Buffer Gets per row: 2,0
    Elapsed Time per Exec: 1.820,6
    I have never investigated this issue, but i have compared these values with an OLTP system (like HR). It seems like the respond time of this SQL increases nearly linear with the amount of data files. The execution plan is always the same.
    The other part is that this is recursive SQL is the high execution rate, but this can be possible, because of the high amount of performed DDLs in a BW system (which also can destroy the DD cache).
    Do you face any performance issues, because of the recursive SQL or do you just notice this one in the shared cursor cache, because of its high amount of buffer gets?
    Regards
    Stefan

  • Parse labview timestamp xml in javascript

    Hi, im reading XML files created from labview7.1 with javascript and it works great, the only problem is that I dont know how to parse the timestamp. For exampel
    <Timestamp>
    <Name>Eximination Date</Name>
    <Cluster>
    <Name></Name>
    <NumElts>4</NumElts>
    <I32>
    <Name></Name>
    <Val>0</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>0</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>-916291696</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>0</Val>
    </I32>
    </Cluster>
    </Timestamp>
    should be the date 2011-01-24 and
    <Timestamp>
    <Name>Eximination Date</Name>
    <Cluster>
    <Name></Name>
    <NumElts>4</NumElts>
    <I32>
    <Name></Name>
    <Val>0</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>0</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>-916205296</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>0</Val>
    </I32>
    </Cluster>
    </Timestamp>
    is 2011-01-25. Any clues?
    Solved!
    Go to Solution.

    Well a timestamp is really a 64bit + 64 bit number in LabVIEW but internally represented as a cluster of 4 * 32 Bit integer since the timestamp was intruduced before LabVIEW supported 64 bit integers.
    The first i64 is the number of seconds since January 1, 1904 UTC and the second u64 is the fractional seconds resulting in a resolution of 1/2^64 =~ 54 * 10^21 or 54 zepto seconds, which might be smaller than quantum physics allows for.
    The -916291696 is in fact the signed integer representation of the unsigned 32 bit integer 3378675600 which is the number of seconds you look for. For now this is enough but if you want to make your routine safe for after 2037 you should account for the upper signed 32 bit integer too. Java not having unsigned integers makes this a bit awkward.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Adt.bat Could not generate timestamp: Cannot parse the response

    I am using the command line to build an air app as follows:
    adt.bat -package -storetype pkcs12 -keystore mycert.pfx
    -storepass xxx -tsa
    http://timestamp.verisign.com/scripts/timstamp.dll
    myApp.air myApp-app.xml myApp.swf
    However, I receive this error:
    Could not generate timestamp: Cannot parse the response
    I am using a Verisign issued Authenticode certificate. Has
    anyone got any idea why this might be happening?
    Thanks

    There is no previous thread running for this application
    (that's the first thing I checked out). As I said in the last
    message, I can successfully launch my app from within FlexBuilder3,
    but not from a generated .air file install.
    At your suggestion, I created a simple "Hello World" type of
    Flex application in FlexBuilder3. From within FlexBuilder3, I
    exported it to an AIR file and installed it. This simple
    application does indeed run on my system after being installed from
    the .air file.
    So there's something different about this new public release
    of the FlexSDK than the last bet release. I compared that simple
    project contents and layout to my project. The big difference is
    that all the source files for the simple project was automatically
    dropped/created in a child 'src' folder under the main project
    folder. I also noticed that when installed, there were files
    missing for my app, but not for the simple app. The big difference
    there being that only the files in the src folder were copied into
    the AIR installer to be installed. Nothing outside of that folder
    was part of the install codebase!
    I therefore refactored my code (yet again) to move all my
    source files (including my external config XML files) into a 'src'
    folder under the main project folder. After a lot of tweaking in
    FlexBuilder3 to get it all working again and running, I exported to
    an AIR file once again. This time all the files were included, when
    I ran the new installer. The application now launches successfully.
    The next step is to replicate this via the command-line ADT
    tool.
    It would have been nice to know the changes in this area (src
    folder) before going this far into the process. Unless they are
    documented in some obscure release note somewhere that I am not
    aware of yet.
    I'll let you know how the ADT run goes when I get the chance.
    Thanks for your help everyone.

  • Parse a timestamp MS SQL column so that flex would understand

    How would I parse a timestamp MS SQL column so that flex
    would understand when I send it to the client?
    Query is written in Cold Fusion.

    Go to
    SQL
    Server Books Online and look up Date and Time functions under
    Transact-SQL Reference-->Functions.
    Phil

Maybe you are looking for