Object to date

I am trying to convert a SQL timestamp (mySQL db) to e dd-mm-yyyy format. The problem I do not know how to convert the object ret to a date. This date is formatted to dd-mm-yyyy in the formatDate method.
If someone can help me with the line 'Date out = ..... ret;', or write a new method which helps me to convert the ret object to a date which i can send to formatDate, I would be gratefull.
        public String getdatum(int target) throws DBException, SQLException
          Object ret = getDBSelect().getColumn(SQL_LABEL[target]);
          Date out = ..... ret;
          return massageOutput(formatDate(out));
     public String formatDate(Date in)      
          SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");          
          return sdf.format(in);     
     }

Great! Now we're getting somewhere. Using this code I finally get results.
public String formatdate(int target) throws DBException, SQLException         
     Object ret = getDBSelect().getColumn(SQL_LABEL[target]);
     Date out = new Date(Long.parseLong(ret.toString()));
     return massageOutput(convertDate(out));
public String convertDate(Date in)
     SimpleDateFormat sdf =      new SimpleDateFormat("dd-MM-yyyy");
     return sdf.format(in);
}But yes, another problem has occured. It seems that the the out variabele does not get the timestamp correctly. The value it shows says 'Tue Jan 13 03:49:23 CET 1970', while it should be 'Thursday, March 6th 2003, 15:07:14 (GMT)' (<- according to my PHP script).
I suppose unix timestamps in Java are the same as in any other language?
Note:
- System.out.println("OBJECT " +ret); returns 1147483647
- System.out.println("DATE LONG "+ret); returns 1147483647

Similar Messages

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • Object Array Data Provider Refresh Possible bug

    Hello
    I am having a problem with Object Array Data Provider in terms that the table's data is not changed corectly after a request as expected, but after two requests.
    Steps to reproduce the bug:
    0. Create a new Visual Web project, call it 'test'.
    Set 'Bundled Tomcat ' or 'Sun 9' as deploy target server.
    Edit 'Page1' of the project.
    1. Create an Entity class, simple class that has only getters and setters with a few fields (lets say 'id' and 'name').
    2. In the SessionBean1 that is generated by the framework create an array of Entity class named 'entityArr', and getters and setters for this field.
    3. Add a new Array Object Data Provider on the page and set in its properties as array the array created in the previous step 'entityArr (SessionBean1)'.
    4. Add a new table component, and set as data provider the provider created in step 3.
    In the Table's Layout map the fields from the Entity class, and set whatever compnents you desire for each component's type or leave the default ones (Static Text).
    5. Add a 'property change trigger component' on the page. I called it like this because I tried the following :
    5.1 A text field and a button to submit the text value
    5.2 A Calendar component with autosubmit
    5.3 A DropDown with autosubmit.
    6. On the property change trigger component created at step 5 set a value_changed method that changes the the array that should be displayed by the table.
    For Example, for a DropDown component, you will have a method like this :
    public void dropDown1_processValueChange(ValueChangeEvent event) {
    String idStr = (String) event.getNewValue();
    System.out.println("Entity id :"+idStr);
    if(idStr .equals("item1")) {
    fillSessionBean1(true);
    else {
    fillSessionBean1(false);
    getSessionBean1().setItemName(idStr);
    private void fillSessionBean1(boolean fillValues) {
    Entity[] values ;
    if(fillValues) {
    values = new Entity[4];
    for ( int i=0;i<values.length; i++) {
    Entity entity = new Entity();
    entity.setDescription("Description "+i);
    entity.setName("Name "+i);
    entity.setId(i) ;
    values[i] = entity;
    else {
    //values = new Entity[0];
    values = null;
    getSessionBean1().setEntityArr(values);
    7. When running the program, if the selected is Item1, the table does not show the array set if on this branch.
    I am using :
    Netbeans 5.5 build 20061017100,
    Visual Web Pack 070104_2,
    Ent.Pack 20061212
    jdk 1.6.0
    Operating Systems : Both Linux Suse10 and Windows.
    If anyone has a solution for this please let me know.

    OK
    While no one responded, I had to think for myself.
    There is a bug in the code generated by netbeans or there is nowhere specified that if you attach an array to a data provider you will have to notify by hand the data provider that the array has changed.
    You will have to put this line that is generated in init function in your valuechanged functions :
    objectArrayDataProvider1.setArray((java.lang.Object[])getValue("#{SessionBean1.entityArr}"));
    I think this aproach is a little bit wrong, even it works.
    I believe the data provider should be notified the array has been changed.
    There could be a much more simple aproaches :
    1. In the code generated by netbeans, if you attach an array to a data provider the data provider will be notified after any set(Object[])
    2. The data provider could have a function so you will ne anle to attach to the data provider an Object (the session bean, in my case) and the name of the function that retrieves the array (in my case, 'getEntityArr') .
    The code generated by netbeans could add this function easily.
    Maybe there are any other better aproaches, and I might be wrong.
    It's good that it works.

  • Netbeans 5.5 + VWP and Object List Data Provider

    Hi there.
    I'm trying to build an Object List Data Provider as in fieldguide_08_dataProviders.
    I'm using Netbeans 5.5 + VWP
    When I try to "Configure the Table" on page 360, there are some difference.
    When I select Object List Data Provider and drop it on the Table component opens an unexpected choose for the target, then I choose tableRowgroup1.
    The JSP souce don't change and is still
    <ui:tableRowGroup binding="#{Schedule.tableRowGroup1}" id="tableRowGroup1" rows="10"
    sourceData="#{Schedule.defaultTableDataProvider}" sourceVar="currentRow">
    When I select objectListDataProvider1 the drop down opposite property list doesn't work. The button opens a selection window with no items.
    Regards.

    A better resource is http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/hibernate.html#object in conjunction with http://blogs.sun.com/LongLiveThePepper/entry/using_netbeans_visual_web_pack

  • ListCellFactory - how to access an object's data associated with list cell?

    I am new to javafx and building a sample app to learn the basics. The app has a list view control and used listcellfactory to create listcells. Each list cell is composed of few labels and image. I populated list view with listViewItems function, where in it sends object[]; I have my own object with data that needs to be populated in the list cell. I have hard coded the object[] and that size is reflected in list view items size. However, I am not able to populate the object data in individual labels.
    In the following code, I can only get the string representation of the object and I am unable to figure out how to individually access the object's data. Please help me with this.
    function listCellFactory(): javafx.scene.control.ListCell {
    var listCell: javafx.scene.control.ListCell;
    def offerLbl: javafx.scene.control.Label = javafx.scene.control.Label {
    text: bind "{listCell.item}"
    def descriptionLbl: javafx.scene.control.Label = javafx.scene.control.Label {
    text: bind "{listCell.item}"
    def friendLbl: javafx.scene.control.Label = javafx.scene.control.Label {
    text: bind "{listCell.item}"
    def offerImgView: javafx.scene.image.ImageView = javafx.scene.image.ImageView {
    image: imagetrial
    fitWidth: 300.0
    fitHeight: 250.0
    def offerVerticalBox: javafx.scene.layout.VBox = javafx.scene.layout.VBox {
    content: [ offerLbl, descriptionLbl, friendLbl, offerImgView, ]
    spacing: 6.0
    listCell = javafx.scene.control.ListCell {
    node: offerVerticalBox
    return listCell
    }

    If I understand you question, it should be (listCell.data as YourClassName)
    Edited by: AigarsP on Oct 21, 2010 2:10 PM

  • Please  tell me the difference between CREATE OBJECT & CREATE DATA ,statements in CRMTECHNICAL

    Please  tell me the difference between CREATE OBJECT & CREATE DATA ,statements in CRMTECHNICAL

    found it on my own . the best way to do this is use the RetriveLimitedHierTreeCommand  with a search on the taxonomy table.

  • Clone schema with current db objects and data.

    Hi Cloud expert,
    I need feature to clone existing schema and create new schema with schema as a service. I created profile that export schema with database objects and data. I created template that use the profile created. While provisioning the template I found all the database objects with template. Now I need a solution to clone the current schema with all the objects at current time. The way I tried contains all the objects that were exists while exporting the schema. I need the solution to clone schema so that it will contains all the objects and data right now.
    While reading document I found snapclone but that is not the exactly the solution I need. I simply need to clone schema with latest db object and data with Self Service portal.
    Thank You in advance.
    Dilli R. Maharjan

    One option is to run BACKUP/RESTORE, once you have restored you run:
    SELECT 'ALTER TABLE ' + quotename(s.name) + '.' + quotename(o.name) +
           ' DISABLE TRIGGER ALL '
    FROM   sys.schemas s
    JOIN   sys.objects o ON o.schema_id = s.schema_id
    WHERE  o.type = 'U'
      AND  EXISTS (SELECT *
                   FROM   sys.triggers tr
                   WHERE  tr.parent_id = o.object_id)
    Copy result and paste into a query window do to run. Next:
    SELECT 'DELETE ' + quotename(s.name) + '.' + quotename(o.name)
    FROM   sys.schemas s
    JOIN   sys.objects o ON o.schema_id = s.schema_id
    WHERE  o.type = 'U'
    Run this result until you don't get any more errors.
    Run the first query again, but change DISABLE to ENABLE.
    This is more long-winding than scripting, particularly if you have lots of data. But you know that you will not make any changes whatsoever to the schema.
    The scripting in SSMS generally does it right, I believe, but some items are not scripted by default. If you run BACKUP/RESTORE, you know that you get a faithful copy.
    Of course, the best way is to keep your code under version control and take the version control system as your ultimate truth.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Date management on internal object master data

    Hi gurus,
    I need to use a set of dates on the internal object master data. On the date profile customizing there isn't anything that reflecting the management of the dates on products or internal object.
    However, on the web UI (Internal Objects details screen) I found the field "Date Profile":
    - component: PRDHS
    - view: PRDHS/Header
    - context node: PRODSETWTY
    - attribute: STRUCT.TIMEPROF
    This field is not active and I also searched for a set type that could allow me to activate it and to insert a date profile for my internal object without success.
    I'm searching the way to activate this field on the internal object master data and to understand if it's possible to use the date profile on it.
    Your help would be very appreciated.
    Thank a lot.
    Massimiliano.

    Hello,
    There are no date profiles assigned to products in the CRM system, I believe the same is true for internal objects.
    Generally, once a product has been added to an order then the dates from the order/APO system are what are taken into account.
    I have checked into internal objects but the only date I can find reference to is a timestamp:
    http://help.sap.com/saphelp_scm50/helpdata/en/f9/a67937b566ab49e10000009b38f842/frameset.htm
    I have also checked on information on the attribute STRUCT.TIMEPROF but haven't found anything.
    Thanks and regards,
    Ita

  • String object to Date object

    Hi,
    I have date as string object "22/04/2008". I want convert this string object to Date object as specified format (dd/MM/yyyy) only.
    Please do the need full.
    Thanks in Advance

    kishoreyakkali wrote:
    Hi,
    I tried as follows
    SimpleDateFormat strOutDt = new SimpleDateFormat("dd/MM/yyyy");
    Date dateObj=strOutDt.parse(strTmp);
    System.out.println("dateObj::::" + dateObj);
    Output : Mon Apr 21 00:00:00 IST 2008 A date object is always a wrapper around a millisecond value. It does not contain any formatting information, so you should never print a Date object. You should always convert it to a String using SimpleDateFormat before you print.
    Kaj

  • Populate object form with already provsioned resource object's data

    OIM Version:
    9102 BP19
    Scenario:
    We have to pre-populate resource object (ModifyObject) form fields with already provisioned resource object (ProvisionedObject) form fields which can be multi-instance resource.
    This provided data will be used modify the already Provisioned resource object data (same ProvisionedObject). And this needs to be handled with approval workflow.
    Approach:
    We will use selected ProvisionedObject’s process instance key on web page in resource object pre-populate adapters. And using that process instance key we will fetch already provisioned resource (ProvisionedObject) object’s data.
    Issue:
    Not sure how can we pass the process instance key from WEB_PAGE to OIM_RESOURCE_OBJECT’s pre-populate adapter.
    Any pointers towards the solution will be appreciated.

    My suggestion is...
    At the time of raising the request, use userKey and in the code use getObjects() to retrieve the provisioned resource object information. Here you can retrieve Process Instance Key of the Provisioned resource and then retrieve the process data. So at this point you will have all the required data of the provisioned resource which can be returned to the object form field.
    This is one approach. Experts may throw more pointers.

  • Info object as Data type as NUMC, master data doesnot store value as 0

    Hello All,
    I have an Info Object whose data type is NUMC.
    It has only text Master Data.
    Id and its description are the two fields of that Master data.
    Now when below data is feeded in to that infoobject through transformation which has 1 to 1 mapping.
    ID              Description
    0                Submiited
    1                 Approved
    2                  cancelled
    The data gets uploaded in text table but.
    0 ID values turns out to be "       "    blank.
    Which is wrong.
    Result in Text Master table:
    ID                Description
                        Submitted
    1                  Approved
    2                 Cancelled
    if the ID is 0 it should be populated as 0 for "submitted"
    No start routine our end routine is ther in the transformation.
    Kinldy help me to solve this issue.
    Points will be assigned

    Hi,
    When an InfoObject is created it'll have a blank record, in case of Numc it'll be as shown below:
    ID  Description
    0   Blank
    But this 0 gets displayed as blank as well.
    When you post transaction/master data you can post it as
    0 for Submitted
    1 for...
    2 for...
    When you do reporting on this & if you only select text display only it'll display "Submitted", which is required. But if you display ID & text or only ID. It'll display # instead of 0.
    See if you can replace this # with 0.
    Mean while i'll be trying to get this solution. I'll post soon if i get the solution.
    Regards,
    Iliyas

  • Why you put object in data model

    Hi All
    I did my interview and interviewer asked me the following question.
    Question Why you put object in data model?
    Appreciate your answer. Thanks
    Regards
    Shu

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by xuechen:
    Hi, I am facing to choose an DBMS product for a big project. Does 8i support an object-oriented or object-relational data model?
    Thank you!<HR></BLOCKQUOTE>
    Hi, Oracle8 and Oracle8i will provide you object relational model. It is not pure object-oriented solution. In the field of databases it is difficult to impliment pure object-oriented solution now a days. But it is easy to understand and design an object-relational design and implimentation. In Oracle8 there are some very useful facilities for such a design like the concept of nested tables. I had a project of defence nature and design in object-relational technique and find much easy and understandable then pure relational approach. If it is possible for you then please be contect with me on mail and send me a little information about your work and experience.
    Regards,
    Awais
    null

  • Shared Object - Prompt Data Permissions Dialog

    Hello,
    I'm creating a small app to run from CD-Rom/local
    installation that will use multiple shared objects for data
    storage. To ensure proper saving without surprising the user with a
    permissions dialog unexpectedly, I'd like to request unlimited data
    storage on first time app launch - Joey Lott shows how to do this
    in the Actionscript Cookbook...
    request=mySO.flush(1024 * 500);
    My question is,
    Can I perform this permissions request with the user a single
    time with a generic app SO in global fashion, so that the
    permissions would be set for any SOs created during the use of the
    product (all written to same SO directory), or do I have to request
    permissions for each and every SO created? Since the latter
    would be unacceptable from a UE standpoint, that means stuffing all
    app data into a single SO which doesn't seem so great from a data
    config perspective...
    I really appreciate your attention and help on this!
    Thanks in advance,
    -Maura

    Hmm. Experimented a bit and it seems that once the permission
    is set it applies to the Flash Player installation globally, and
    not per SO, not even per domain...
    Or, please correct me if I'm mistaken.
    Thanks.

  • Effect from build time dependent  2 attribute in info object master data

    Dear all,
    i creat time dependent  2 attributes in info object master data (ZCURRLUM) which use in info cube. after that i open workbook or query, it has short dump which error message
       "UNCAUGHT_EXCEPTION" "CX_RSR_X_MESSAGE"
       "CL_RSBOLAP_BICS_SERVICES======CP" or "CL_RSBOLAP_BICS_SERVICES======CM003"
       "HANDLE_UNCAUGHT_EXCEPTION"
    Question: info object master data can't use more than a attribute time dependent???
    i use in BI 7.0 level 14
    thanks for your help
    regards,
    Joy

    Hi Chandamita Sarmah,
    I copy error code to you from line 1 to line 28
    METHOD handle_uncaught_exception.
      data:
        l_r_program_error  TYPE REF TO cx_rsbolap_program_error.
      data: lBExDebug type rs_bool.
      GET PARAMETER ID 'BEXDEBUG' FIELD lBExDebug.
      if lBExDebug = rs_c_true or CL_RSTT_TRACE=>GET_TRACEMODE_CURRENT_TRACE( ) = rstt0_c_tracem
    Break-point for debugging, e.g. during running a trace
        break-point.  "#EC NOBREAK
      endif.
    Subcall?
      if P_RFC_CALL_DEPTH > 1.
      Forward the exception
        subtract 1 from P_RFC_CALL_DEPTH.
        DATA: l_r_x TYPE REF TO cx_no_check.
        TRY.
           l_r_x ?= i_r_exception.
          CATCH cx_root.
            CLEAR l_r_x.
        ENDTRY.
        IF l_r_x IS INITIAL.
          RAISE EXCEPTION TYPE cx_rsr_propagate_x
            EXPORTING
              previous = i_r_exception.
        ELSE.
        RAISE EXCEPTION l_r_x.
        ENDIF.
      endif.
    All exceptions should have been caugth -> X-Message
    Thanks a lot for your help
    Joy

  • Table with object array data provider

    hi!
    i use the studio creator table and want to fill it with an object array data provider!
    i have an array and the getter:
      public TanData[] getTanDataArray()
            return tanDataArray;    
        }i choosed this for the data provider and in table layout i choose the dataprovider, but when i run my application there are no datas found although the array isn't empty!

    maybe this is a problem:
    i got my data from a database table and i store it in a vector.
    in the example they have a class WeekBean and they fill their array with
       WeekBean[] weeks = {
                new WeekBean(1),
                new WeekBean(2),
                new WeekBean(3),
                new WeekBean(4)
            };and i tried to do this:
        private Vector<TanData> tanDataList = new Vector();
        private TanData[] tanDataArray;
       getTanDataList().copyInto(tanDataArray);could it be that that isn't correct?

  • Passing serialized object and data as byte stream over same stream

    I am writing a chat program, I am keeping online user List as Vector A would like to pass online user List to client as Vector object also the client message is sended as byte stream. Is it possible to pass object and data as byte stream over the same stream.

    I am writing a chat program, I am keeping online user
    List as Vector A would like to pass online user List
    to client as Vector object also the client message is
    sended as byte stream. Is it possible to pass object
    and data as byte stream over the same stream.Why are you sending the client message as a byte stream?
    String seems a much more logical type. I would assume that you're reading strings from one client, and printing them on the others. If you translate to bytes in the middle, you're going to have to ensure that you decode those streams correctly on the other side.
    And if I were implementing this, I probably wouldn't send the raw Vector or List ... instead, I'd create a Message object, which wraps the Vector/String, and a MessageDispatcher interface, which the client implements to handle incoming messages.

Maybe you are looking for

  • Oracle 8i on linux 6.2

    I'm trying to install Oracle 8.1.5 on Red Hat Linux 6.2 After installing and config JRE with symbolic Link when i try to run ./runInstaller I get foll. error Initializing JVM from /usr/local/jre/bin/jre Please wait.... Error in CreateOUTProcess():-1

  • Open attachments in compatible third-party apps.

    I have I-phone 32 GS and I upgrade to IOS 4 Can any one adv me how to open attachments in compatible third-party apps. my emails are MFE

  • Problem in "Process.waitFor()" in multithreaded application (UNIX OS)

    Hello all This is very urgent for me. I am using the follwing code to invoke the child process which calls a shell script in the unix OS,and it is going fine when runs in single thread. But if i run it as the multhreaded appln, anyone of the thread h

  • Apex charts and IPad

    http://www.anychart.com/blog/2011/03/24/html5-version-of-anychart-coming-soon/ They will release AnyChart HTML5 version. Is there any way to incorporate these charts into existing apex applications? Goal is simple: get charts working on IPad...

  • When checking my Service and Support Coverage is states that my iPhone 5 is not activated.

    I activated my phone on the 21st, from the phone, right when I received it. It's been working fine. I also got an e-mail from Apple stating to reply to it to receive AppleCare +, which I did, and that seemed to go through. The odd thing is, that when