Java with excel

hi all,
Is it possible to submit the values from an excel sheet to java
Thanks in advance

Another approach is to export the spreadsheet as "csv" (comma-separated-values).
That you can read without a special package.

Similar Messages

  • SQL insert statement in java with Excel file

    Dear all,
    I wrote a program is as the follow:
    import java.io.*;
    import java.sql.*;
    public class handleExcel
         Connection con = null;
         Statement stmnt = null;
         public handleExcel()
              String excel = "C:\\EGS\\app_files\\info_update_form_exported_data.xls";
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   String str="jdbc:odbc:DRIVER=Microsoft Excel Driver (*.xls);DBQ=" + excel + ";";
         String sql = "insert into [Sheet1$] (Name, Age, Test1, Test2, Test3) values ('mary','16','aa','bb','vv')";
                   con = DriverManager.getConnection(str, "", "");
                   stmnt = con.createStatement();
                   stmnt.executeUpdate(sql);
              catch(Exception e)
                   System.out.println("con is error!!");
                   e.printStackTrace();
         public static void main(String[] args)
              handleExcel TestHpc = new handleExcel();
    But when I run it, the error is as the follow:
    java.sql.SQLException: [Microsoft][ODBC Excel Driver]
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3111)
         at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338)
         at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(JdbcOdbcStatement.java:288)
         at hk.gov.edb.util.handleExcel.<init>(handleExcel.java:31)
         at hk.gov.edb.util.handleExcel.main(handleExcel.java:97)
    Please help me to solve this problem. Thank you so much for your help!
    Regards,
    kzyo

    Hi
    You can use the[b] jakarta POI api in order to read/write Excel file from java. Pure Java, no drivers nedeed.
    I tested and ok.
    Hope this helps

  • Java with EXCEL and Access

    I have a program that imports an EXCEL file as an Access database.
    One field in the EXCEL file contains ZIP codes which, when imported into the database are stored as numbers/double. I would , however, like to import these as char. Any way I could do this using a code?

    I am using the resultset and the metadata functions to get the column type. I use the getString(6) function in the resultset..which returns the data type..
    When the zips are arranged in random order..this retuens the column type as NUMBER which messes up the program...however if I arrange the column in the descending order...it returns VARCHAR and the program runs perfectly...How can I get it to return NUMBER even if the contents of the column are arranged randomly?

  • CSV file encoded as UTF - 8 loses characters when displayed with excel 2010

    Hello everybody,
    I have adapted a customer report to be able to send certain data via mail a a CSV attachment.
    For that purpose I am using class cl_bcs.
    Everything goes fine, but since mail attachment contains certain german characters as Ü, when displaying it with excel those characters appear as corrupted.
    It seems the problem is with excel, because when opening the same file with notepad, the Ü is there. If I import the file to excel with the importer, it is correct too.
    Anyway, is there any solution to this problem?
    I have tried concatenating byte_order_mark_utf8 in the beginning of the file, but still excel does not recognize it.
    Thanks in advance,
    Pablo.
    Edited by: katathema on Jan 31, 2012 2:05 PM

    - Does ms excell actually support UTF-8
    Yes. I believed that we installed some international add-on which is not in default installnation. Anyway, other UTF-8 or UTF-16 file can be openned and viewed by Excel without any problem.
    - have you verifide that the file is viewable as a UTF-8 -encoded file
    I think so. If I open it into Notepad and choose "save as", the file type if UTF-8 file
    - Try opening the file in a program you are confident
    that it support UTF-8 - eg. Mozilla...
    I will try that.
    - Check that your UTF-8 -encoded file has a UTF-8 identifier (0xFEFF ?)
    as the first character
    The unicode-16(LE or BE) file I got from internet, I found there is always two bytes in the front. (0xFEFF or 0xFFFE). My UTF-8 file generated by java doesn't have that. But should UTF-8 file also has this kind of specifcal bytes in the front? If I manually add these bytes in the front of my file using Ultraeditor and open it in Excel2000, it didn't help.
    - Try using another spreadsheet program that supports UTF-8
    Do you know any other spreadsheet program supports csv file and UTF-8.

  • Jdbc with excel

    hi
    i am developing a software in java and i wanted it to connect to excel as a database so pls suggest me that how i can connect my program with excel for doing all the database operations

    Better even "jdbc excel" - at least two promising hits right at the beginning...

  • Excel Workbook with Excel Data Model stored on SharePoint - daily refresh

    I'm not sure if this is exactly the right forum but I'm hoping that someone here can either answer or point me in the right direction.
    I have an Excel Workbook with an Excel Data Model.
    The Excel Data Model uses SQL to contact our data warehouse and pull through data into tables.
    We are storing the Workbook on a SharePoint site and viewing it using Excel Services.
    The data in our data warehouse is updated daily and so I would like to refresh the workbook daily and remove the option to refresh the data in the browser.
    Is this possible with a workbook that has an Excel Data Model (I've seen lots of posts that relate to workbooks with connections to tabular models).
    Thanks
    Paul

    Hi Paul,
    I have answered this issue in this thread that you posted in SQL Server PowerPivot for SharePoint forum, please see:
    http://social.msdn.microsoft.com/Forums/en-US/9627939c-e9f1-48ae-a6ed-0c238d8f2d69/excel-workbook-with-excel-data-model-stored-on-sharepoint-daily-refresh?forum=sqlkjpowerpointforsharepoint
    Furthermore, this issue is more related to PowerPivot for SharePoint. If you have any more questions about PowerPivot for SharePoint, I would sugget you open a new thread in the forum below for better support:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=sqlkjpowerpointforsharepoint
    Thanks for your understanding.
    Regards,
    Elvis Long
    TechNet Community Support

  • Excel empty with 'excel inplace' option

    Hi everyone,
    in order to show my alv data in an excel format, with 'excel inplace' option, this sheet appears empty. However, if i choose to download the data into a excel file, it appears right.
    Do you know the reason of this?
    Thanks

    Implement OSS Note 782922 - Excel Inplace: Header Sheet contains garbage characters.
    This will require installation of SAP GUI Patch Level 8.
    Also , You can try be installing SAP GUI with all options checked.

  • Report Generation Toolkit with Excel 2003 and Excel 2000

    Hello,
    I'm using the Report Generation Toolkit to generate an Excel report from an Excel template.
    The "NI_Excel.lvclass" is included in the "source" section of the application builder options.
    I create an exe file on  a PC where Excel 2003 is installed. On a Notebook, where only Excel 2000 is installed, the application crashes at the generation of the report:
    I guess the problem is the different version of Excel but I don't know. On the developer PC with Excel 2003 it works fine.
    In this document it's only talked about different Word versions.
    How can I use the Report Generation Toolkit here?
    I'm using it that way:
    Regards

    Oh, it seems that the Report Generation Toolkit "only" supports Excel XP/2003/2007.
    I think, that's the problem.

  • Problem with Excel output format

    Hi Guys,
    I am creating a report in XML Publisher (not standalone). I am facing some problems could anyone please help me to figure out the issues.
    Is it possible to have all three output format (PDF, HTML & EXCEL) exact (same aligned) only by creating a single RTF Template? I am facing the problem with Excel output format the output format of excel is taking excels cell formatting.
    Example Numeric fields --> Right Aligned, text fields --> Left Aligned
    One more issue with excel is -ve(negative) values are getting displayed in red and in brackets like ($13) (with red color).
    Our client want excel output on priority.
    Is there any limitation for excel output format of reports?
    It is very urgent for us please help.
    Any help would be highly appreciated.
    Thanks,
    Pragati
    Edited by: user11237443 on Aug 27, 2009 1:22 AM

    Hi Mahi,
    Thanks for your response. But i could not understand how can we write wrapper program could you please give some light on this or provide some link it would be helpful for me:-)
    I have read that blog for excel limitations but i have more question?
    1) What about the negative values?
    if any field is displaying negative amount then excel not displaying right value for that:(
    2)How can we align header or data?
    Do XMLP with EBS provide any solution for formatting in excel?
    3) If for the alignment of numeric value we concatenate them with any special character then how can we perform calculation that field?
    Here are so many formatting issues do we need to write any code in xml for that?
    Please help.
    Many Thanks,
    Pragati

  • Known issues for OBIEE Office Add in with Excel 2007?

    Hi,
    Does anybody know if there are issues for the office add-in with Office 2007?
    i'm playing around a little bit to see how it works, but it seems that Excel interferes with the layout.
    I do get different grafs and also i tried the tutorial with the excel template and my changes come only partly through.
    Thanks
    Sandra

    Hi Sandra,
    Were you able to use OBIEE Office Add in with Excel 2007? I am planning to look at this compatibility. I am looking here to seeif anyone found issues with this setup..
    Thanks,
    Bharat

  • Problem with images in XML with excel output

    Hello:
    I made an XML concurrent program, with excel output, but i am having a problem:
    The rtf template has a logo (bmp image), but it is not showing in the excel (if i execute the concurrent in the oracle applications). However, if i create the xml in Oracle Reports in my computer, and then load that xml in the rdf template in word, i can see the logo in the excel preview. I don't know why is it not showing when i execute the program in applications.
    If someone can help me with this, i will be very grateful.
    Greetings
    Message was edited by:
    user632438

    xml cP, will not give you a image in excel output,..
    In RDF there is a placeholder for image, and the image is located in certain location, at runtime it picks and render the output with logo.
    but xml CP, will get the data in xml type and merge with rtf to get the output you wanted..
    if you have the rtf with logo embedded in it, if output is of pdf or rtf output , then it will display the logo ,.
    in excel currently it is not possible to show the logo,..
    excel you see could be xml-excel or csv-excel not the true binary excel.
    to get the logo embedded ,for that you have to wait on tim for the excel template, which will be release in near future i guess..

  • Run BI Publisher report (with Excel template) on Windows 7

    Hi, All.
    Sorry for my English :)
    I have some problem:
    I use BIP standalone for my reports. Some reports are in Excel (with Excel template). When I run it on PC with WinXP - all is OK. But, when I try to run it on PC with Win7, then Excel is opening and writing this "Native file format and file extension does not mismatch. Before open be sure of file does not damage" (this is my translation). If I try save file on the hard disk, then file is 0 kb. But if a report has RTF-template, then it opening normaly on Win7's PC.
    Have you any ideas?
    Thanks!

    option1:
    The query should be same @ detail level, only the template has to be different for summary and details.
    @runtime, user can choose to see the detail/summary
    Disadvantage, if the data is huge,
    advantage , only one report.
    option2:
    create two separate reports summary and details
    and create diff data and diff layout and keep it as different report
    Advantage, query will perform based on the user run report, summary/detail, so that you can write efficient query.
    Dis advantage , two reports query/template to be maintained.

  • Error in communicating with Excel Calculation Services

    When attempting to use Excel Web Access web part, I get "We're sorry. We ran into a problem completing your request. Please try that again in a few minutes."
    Checked event log and found
    There was an error in communicating with Excel Calculation Services
    http://my server:32843/49082a5d56c141629497dd8b28375f47/ExcelService*.asmx exception: The remote server returned an error: (503) Server Unavailable.
    [Session:
    User: ].
    I googled the error and, as suggested by various sources, rebooted the server. (Same issue occurs) I also tried disabling asp.net impersonation with no change.  Ideas?

    Hi ,
    Reason for the error :
    The Excel Services Application server computer is in a non-valid state and may need to be restarted.
    Resolution : (Before taking the step toward to restart the server, try the below option)
    Restart your excel service application app pool/ restart the excel service. (Reference :http://technet.microsoft.com/en-us/library/ee513104(v=office.14).aspx)
    If you have more than one application server in the farm , then try start the excel serviceto a different server.
    Regards,
    Senthil

  • Error message when opening a shared workbook with Excel 2007

    Hello,
    We would like to share a workbook outside BW (by saving into a serveur).Since we use Excel 2007, we can't anymore open this workbook.
    We have a message error (see bellow).
    For your information, it was ok with Excel 2003.
    When whe save the workbook in local disk and then copy from local disk
    to a serveur, it's ok.
    We use SAPGUI 7.10 support package 8, patch 1 Revision 1443 & BI 7.0.
    Best regards
    Nicolas Triqnuand

    hey Nicolas,
    first of all, your error message is in French... not too many people out there will be able to understand. Eventhough I do understand French, it doesn't make much sense to me... BUT... in Excel2007 all macro's are by default disabled. When you enable them (you should get a "Security Warning" right under "the Ribbon"), your BI stuff should work again.
    Just gave it a try, and it runs smoothly over here.
    Cheers,
    RafB

  • Error Message: "Excel cannot complete this task with available resources" when creating pivot table with Excel 2013

    Hi, 
    One of our users encountered this problem with Excel 2013 while creating pivot tables, particularly with large files. We tried to modify Virtual Memory
    of the pc but error still persist. Why does this happen and how can we resolve this? Thanks.
    Another error message encountered by the user, this time when opening large files. The files she tried to open are working fine in 2010. But when opened in 2013, it prompted : "There
    isn't enough memory to complete this action. Try using less data or closing other applications."

    Hi,
    In regarding of the issue, please provide us more information to assist you better.
    Did your user using the Excel 2013 and Excel 2010 with same PC? If not, please let me know the both of the 2 PCs' hardware list/Windows operation system info.
    Did you using Excel 2013 32bit version and Excel 2010 64bit version?
    General speaking, this issue usually occurs with Office 2013 32 bit version. It has a limitation of 2Gb of memory that can be used by its process. And the 64-bit Excel can handle larger workbooks.
    Thus, if your user using 32bit Excel, I recommend try 64bit Excel instead.
    Here is a similar issue, we also could try it:
    http://answers.microsoft.com/en-us/office/forum/office_2007-excel/excel-cannot-complete-the-task-with-available/d31b1822-ebde-4c9b-8d11-e54bb652847d
    If you have any update, please feel free let us know.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

Maybe you are looking for

  • Ipod Nano turns automatically on and off

    Hi there, I have the following problem. My Ipod Nano 4GB turns always on and off. The result is, that my windows pc can't recognise it. I have tried everything to restore the ipod, but this doesn't work as well. As soon as I push the Menu the Select

  • How to call sshr page in custom oaf page

    hey everyone, i would like to access the leave of absence page by creating a link on the custom oaf page. So that whenever i click on this link it will open the below page. Below is the function details for the jsp page that i want the link to open i

  • Need help with data leakage - ATT no help but may get phone back!

    Newb here and I have an issue. Three weeks with the phone and finally got over my fear of an active app and downloaded a biking app. Did two 6 mile rides and went home to check data usage. ATT had not posted my usage yet (they run a couple of days be

  • Payment Block Indicator

    I am using the payment block indicator in the import HEADERDATA for BAPI_INCOMINGINVOICE_CREATE and the table ACCOUNTPAYABLE for BAPI_ACC_INVOICE_RECEIPT_POST.  It can be set to *, A, B, N, P, R or V.  Can other indicators be defined or are these the

  • Exporting Versions without Version # included in name

    Hi all, I am trialing 1.5 and would like to upload lores Jpegs of a single version of each of my master files to Photoshelter. Everything works well except that I don't want to include the version # in the file name. I have renamed the files from the