Problem in writing data to excel spread sheet using jdbc

Hi Friend,
I have written a jdbc application ,that retrives data from oracle8i database and writes to excel spread sheet.
Here I am facing a problem while writing date vales to the spread sheet.
It is just writing 00.00.0 , instead of a date like 21/10/2005, where I am going wrong , can any one guide me.
Thanks in advance.

Don't cross-post!
http://forum.java.sun.com/thread.jspa?threadID=643815&tstart=0
Especially when you already got your answer in the other post jackass. If you don't understand the answer then say so there.

Similar Messages

  • Problem in writing data to excel spread sheet

    Hi Folks,
    I have developed a jdbc application that writes data to excel spread sheet.while trying to write data to excel, it could not write date values properly.it is writing 00.00.0 for all the date feilds.
    Can some one help here.
    Thanks in advance.

    You can try VistaJDBC at http://www.easyhr.com.au/software/easy_mdb_mde_compactor.htm .
    Otherwise you can write your code to csv/xml/dbase III format, since Excel can open those file format easily.

  • How to transfer a set of data from Excel spread sheet to an Access database

    hi,
    Can any one please tell me how to transfer a set of data from Excel spread sheet to an Access database using SQL query.I'm using java API currently. I have done all sorts of ODBC connection in administrative tools.The file is in correct location. I have done certain coding but with errors.Help me to get rid of these errors,
    Coding:*
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection datacon=DriverManager.getConnection("jdbc:odbc:exdata","",""); *//For Excel driver*
    Connection datacon1=DriverManager.getConnection("jdbc:odbc:stock1","",""); *// For mdb driver*
    Statement datast=datacon.createStatement();
    Statement datast1=datacon1.createStatement();
    ResultSet excelrs=datast.executeQuery("select item_code,sdata,closing_stock from phy "); *//phy is the excel file*
    while(excelrs.next())
    String ic=excelrs.getString("item_code");
    System.out.println(ic);
    String d=excelrs.getString("sdate");
    double cs=excelrs.getDouble("closing_stock");
    int dbrs=datast1.executeUpdate("insert into second values('"+ic+"','"+d+"',"+cs+")"); *//second is the mdb*
    excelrs.close();
    }catch(Exception e)
    System.out.println(e);
    Error:*
    java.sql.SQLException: [Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'C:\JavaGreen\phy.xls'. Make sure the object exists and that you spell its name and the path name correctly.
    thanks,
    kumar.

    JAVA_GREEN wrote:
    No i haven't mixed up.But the file from where i have to retrieve the data is in csv format.Even though i created another csv driver.and tried but i cud not find a solution to load/transfer a set of records from one file(in Excel/csv format) to another file(in mdb format).plz help me.Is there any other methods for this data transfer.A csv file is NOT an excel file.
    The fact that Excel can import a csv file doesn't make it an excel file.
    If you have a csv file then you must use a csv driver or just use other code (not jdbc) to access it. There is, normally, a ODBC (nothing to do with java) text driver that can do that.

  • Uploading excel spread sheet using gui_upload

    Can any one guide me for how to upload excel spread sheet using function gui_upload.

    Use the FM gui_upload.
    TYPES : BEGIN OF tp_data,
              line(4096),
            END   OF tp_data.
    DATA: l_filename_ip TYPE string,
            tl_data       TYPE STANDARD TABLE OF tp_data WITH HEADER LINE.
      l_filename_ip = p_input.
    *--Upload Data
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename                = l_filename_ip
                filetype                = 'ASC'
                has_field_separator     = ''
           TABLES
                data_tab                = tl_data
           EXCEPTIONS
                file_open_error         = 1
                file_read_error         = 2
                no_batch                = 3
                gui_refuse_filetransfer = 4
                invalid_type            = 5
                no_authority            = 6
                unknown_error           = 7
                bad_data_format         = 8
                header_not_allowed      = 9
                separator_not_allowed   = 10
                header_too_long         = 11
                unknown_dp_error        = 12
                access_denied           = 13
                dp_out_of_memory        = 14
                disk_full               = 15
                dp_timeout              = 16
                OTHERS                  = 17.
    File name is string type so convert it into string as shown above. Now give the path of the required file and give the required extension. Extension is necessary. Give EXL fr excel sheet and TXT for notepad file etc. Call the FM and u will get all the data in the internal table tl_data.
    Now once u get all the data in tl_data u can split it into ure required internal table as shown below.
    Write the below logic after calling the above FM.
    LOOP AT tl_data .
    *--Taking the contents of the input file leaving the header part
          PERFORM split_and_save USING tl_data-line.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " gui_upload
    *&      Form  split_and_save
          Splitting the contents from the input file and saving them into
          an internal table
         -->P_TL_DATA_LINE  text
    FORM split_and_save USING fp_data.
    *--Local data declaration
      DATA : tl_data TYPE STANDARD TABLE OF tp_data WITH HEADER LINE,
             l_type  TYPE c,
             c_comma(1) TYPE c VALUE ','.
    *--Split at the Comma
      SPLIT fp_data AT c_comma INTO TABLE tl_data.
      CLEAR inputtab.
    *--Move it to the target fields
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE inputtab TO <fs_field>.
        IF NOT sy-subrc IS INITIAL.
          EXIT.
        ENDIF.
    *--Extract source data
        CLEAR tl_data.
        READ TABLE tl_data INDEX sy-index.
    *--Populate the target
        <fs_field> = tl_data-line.
      ENDDO.
    *--Append this record
      APPEND inputtab.
    ENDFORM.                    " split_and_save
    The above code will give u the required internal table.
    Reward if helpful..
    Cheers,
    Sharadendu

  • Reading the Excel Spread sheet using PL/SQL

    Is there any way how to read a Excel spred sheet using PL/SQL and load in a table.Please help if any one knows about this
    Thanks
    Rama

    http://www.oraxcel.com/

  • Facing problem in writing data to excel sheet using ActiveX

    Hi.
    I want to write data from a one dimesional array to a particular excel sheet in a particular row.Please see the attached vi for explantion.
    It is giving error.But If I give a new file name when the appliation is getting closed it is writing data to the new excel file.
    Please help.
    Thanks in advance
    Attachments:
    Excel sheetWrite.vi ‏90 KB

    Thanks Jhoskin and Rudi .......
    I am able to write data to excel sheet now. I am attaching one"test.zip" file that contains a VI named "Squence.vi "that contains another subVI named "Write U94006 Table To XL.vi"which does the functionality of counting the number of rows in the excel sheet and writing data in the next blank row. I am using the same subVI in the VI named "Sequence.vi"two times so it is taking a lot of time in opening and closing the excel sheet. Will you please suggest some way of calling the subVI only one time.
    Rikki
    Attachments:
    Test.zip ‏105 KB

  • Problem while writing data on xls file using jxl API

    Hi,
    I am getting problem while writing data on excel file using jxl api.
    When i write data on file and all handles associated to the file are closed, file size increases but when i open the file nothing is written in it and when file is closed manually from excel window, file size decreased to its original that was before writing data.
    here is code:
              FileOutputStream os = new FileOutputStream(this.dirPath + this.fileName, true);
              WritableWorkbook this.workbook = Workbook.createWorkbook(os);
    after writing data following handler are closed:
    this.os.flush();
                        this.workbook.write();
                        this.workbook.close();
                        this.os.close();
                        this.os = null;
    can any body help me.
    Thanks in advance

    Err, I did help you. I did understand your problem; and I solved it for you. What was missing was that you apparently made no effort to understand what you were being told. Or even consider it. You just argued about it, as though you were the one with the solution, instead of the one whose code didn't work.
    And the other thing that was missing was the part where you said 'thank you' to me for solving your problem. Somewhat more appropriate than biting the hand that fed you, frankly. I do this for nothing, on my own gas, and it's extremely irritating when people keep asking about problems I have already solved for them. I am entitled to discourage that. It's part of making them more efficient actually.
    But it happens often enough that it also makes me think I'm just wasting my time. Probably I am.

  • SAP BO XCelsius : Drilldown from pie chart to raw data ( Excel Spread Sheet) in Xcelsius

    Hi,
    I am working on a dashboard where my requirement says, Drill down data from Pie-Chart to Raw data ( Excel Spread sheet).
    Clicking on one pie should show me the required data in Excel format
    May I know if this is possible to create from Dashboard design tool SAP R4
    Thanks
    Javeed

    Hi Javeed,
    Drilling data from pie charts is very much possible. The data drilled down can be shown either in spread sheet format via components called "Scorecard" "List View". But if its specified that you need the current data drilled down to a separate excel spread sheet only then, you may need to use the third party components for it.
    There are many such components available for free. There are components available which are paid as well. You will have to find out which ones are free. Check out the threads below.
    How to export data out of Xcelsius to Excel
    CSV Connector
    http://pentaho-bi-suite.blogspot.sg/2013/12/exporting-table-component-to-excel-or.html
    Export Data from Dashboards | Just-BI | Business Intelligence
    SAP Dashboard Components - Multi Colour Column Chart, Hierarchical ComboBox &amp; Export To Excel Manufacturer from Beng…
    SAPexperts | Give Dashboard Users the Ability to Export Data to Excel at Run Time
    I hope this derives you to come conclusion.
    Thanks,
    Sara

  • I need to download data from Oracle data base into a Excel spread sheet

    I need to download data from Oracle data base into a Excel spread sheet.
    Any input will be appreciated.

    Goes something like this:
    1) create an ODBC connection (on NT/WIN: ODBC DATA SOURCES in the control panel, create a USER DSN.
    2) in EXCEL-menu: DATA->GET EXTERNAL DATA->CREATE NEW QUERY. In the wizzard you will see the DSN created in the previous step. Select that source.
    3) follow the wizzard.
    Hope this does any good...
    Regards,

  • I want to open excel spread sheets make additions and export back to pc users.  Is numbers suitable for this activity?

    I want to open excel spread sheets make additions and export back to pc users.  Is numbers suitable for this activity?  I am using a MACBook Air

    just read this in an other answer:
    Pages can open docx files, Numbers can open xlsx files. Each can export to  can export .doc or .xls to the newest Word or Excel format.respectvely, but not to the more recent .docx or .xlsx.
    Translation is not perfect in either direction. Numbers and Excel handle some similar features (eg. pop-up menus vs data validation) differently, and the translator cannot translate from one implementation to the other.
    If much of your work is going to be transferred between your machine and Windows machines running either MS Excel or MS Word, with editing taking place at both ends of the tunnel, then you'll probably be better off with Office, or one of the Office clones on the Mac end.

  • When I download an excel spread sheet from a Ford web site I seem to be getting code and not the work sheet. Example- MIME-Version: 1.0 X-Document-Type: Workbook Content-Type: multipart/related; boundary="====Boundary===="

    I have a Macbook Air. I have MS office installed and work in Excel often with no issues. But When I download an excel spread sheet from a Ford web site I seem to be getting code and not the work sheet.
    Example-
    MIME-Version: 1.0
    X-Document-Type: Workbook
    Content-Type: multipart/related; boundary="====Boundary===="
    --====Boundary====
    Content-Location: file:///C:/HOLD.XHT
    Content-Transfer-Encoding: 8bit
    Content-Type: text/html; charset="utf-8"
    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">
    <HEAD>
    <meta name="Excel Workbook Frameset">
    <xml>
    <x:ExcelWorkbook>
      <x:ExcelWorksheets>
       <x:ExcelWorksheet>
        <x:Name>BTB</x:Name>
        <x:WorksheetSource HRef="./IBIT0001.xht"/>
       </x:ExcelWorksheet>
       <x:ExcelWorksheet>
        <x:Name>GSM</x:Name>
        <x:WorksheetSource HRef="./IBIT0002.xht"/>
       </x:ExcelWorksheet>
       <x:ExcelWorksheet>
        <x:Name>RODetail</x:Name>
        <x:WorksheetSource HRef="./IBIT0003.xht"/>
       </x:ExcelWorksheet>
      </x:ExcelWorksheets>
    </x:ExcelWorkbook>
    </xml>
    </HEAD>
    </HTML>
    --====Boundary====
    Content-Location: file:///C:/IBIT0001.xht
    Content-Transfer-Encoding: 8bit
    Content-Type: text/html; charset="utf-8"
    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">
    <HEAD>
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <style>
    <!--table
            {mso-displayed-decimal-separator:"\.";
            mso-displayed-thousand-separator:"\,";}
    @page
            {margin:1.0in .75in 1.0in .75in;
            mso-header-margin:.5in;
            mso-footer-margin:.5in;
            mso-page-orientation:landscape;}
    tr
            {mso-height-source:auto;}
    col
            {mso-width-source:auto;}
    br
            {mso-data-placement:same-cell;}
    .style21
            {color:blue;
            font-size:10.0pt;
            font-weight:400;
            font-style:normal;
            text-decoration:underline;
            text-underline-style:single;
            font-family:Arial;

    Try search/ask in the forum devoted entirely to Excel issues:
    http://answers.microsoft.com/en-us/mac/forum/macexcel

  • How to use a servlet to display an excel spread sheet onto a browser?

    Hi, I have a problem here, I couldn't display an excel spread sheet onto a browser..Can anybody enlighten me on how to go about it?
    Thanks

    Hi, I tried to refresh the 'application/vnd.ms-excel'
    page by calling it again from another frame...it give me a blank page.
    Does it means that the excel sheet cannot be reopen once it's open?
    thanks

  • Create new users from an excel spread sheet

    Hi Everyone.
    I am very new to SAP and I have only done the ABAP programming course last month.
    To make mme become familiar with ABAP - I was given a task of creating users from an Excel spread sheet - This will be used later on when we implement the new SAP system and decommision the legacy system.
    I am just wondering If anyone has created such program - I would appreciated If I can have a copy So I can learn how it is done -
    At the moment, I was thinking of using BAPI_USER_CREATE1 and BAPI_TRANSACTION_COMIT to create users and optimise the creation call. Is there any thing else that I should be aware of ? I'd be appreciated if someone drop me some ideas - Thanks in Advance

    Hi Samantak.
    Thanks for your quick response.
    Since posting the question, I discovered that within  'BAPI_USER_CREATE1'  sub-call statements - comit is already done. Now my questions are:
    1) Do I still need 'BAPI_TRANSACTION_COMIT' to optimise the CREATE new newusers call ?  Apparently, yes.......I am curious for the reason 'why' since comitting is already done.
    2) I did an interactive call of the 'BAPI_USER_CREATE1'  - a user id was actually created in the system.  Now, my second question is.. Is there a way of calling 'BAPI_USER_CREATE1'  without comitting the data (i.e. create user record on file)..
    I want to call this whout comitting because I want to sort out the number of 'good' records from the supplied data list - and presenting the success percentage to the users before comitting the data.
    Thanks

  • Telephone numbers in a excel spread sheet not recognized by Adobe Acrobat DC

    Before my upgrade to Adobe Acrobat DC on my iPhone, telephone numbers in a excel spread sheet was recognized by Acrobat Reader as such i.e. You would touch and hold the number, then a 'pop up' would appear that gave the option to 'CALL' or 'SEND A MESSAGE'. This function no longer works in Adobe Acrobat DC, why not?

    Hi,
    Acrobat DC for iOS uses the Apple iOS SDK to display the preview of non-PDF documents (e.g. Word, Excel, PowerPoint).
    It looks like an Apple bug for failing to auto-detect phone numbers only in Excel spreadsheets.
    I opened my Excel (.xlsx and .xls), Word (.docx), PowerPoint (.pptx) documents with phone numbers in Acrobat DC for iOS.   The phone numbers in the Word and PowerPoint documents were correctly recognized as such.  In the preview, the plain text turns into blue underlined text.  When you press and hold over the phone number, you will get the options that you have mentioned.
    On the other hand, the phone numbers in the Excel spreadsheet were not recognized in the preview.  In Excel, I used Format Cells > Number > Special > Phone Number with United States (English) as language.  But it did not fix the problem.
    As it turns out, the Apple Mail preview (on iOS 8) has the same problem.  You can also email your Excel spreadsheet to yourself and open it in Apple Mail on your iPhone to confirm that it is an Apple bug.
    You may want to post a question in the Apple Support
    iPhone - Mail, Contacts, Calendars - Apple Support
    or use Word documents instead for auto-detection of phone numbers.
    Sorry for the inconvenience.

  • How to export data from a spread sheet which has multiple work sheets?

    How to export data from a spread sheet which has multiple work sheets to a single text file with fixed length fields?

    Hello s1,
    saving them as CSV will not give a fixed legth output but, as the naming says, a Character Separated Value file.
    Regards
    Marcus

Maybe you are looking for