using Java writing / to write on an excel file (column, row)

Posted on 2007-07-26
Last Modified: 2013-12-29
Using java (jdbc), can I write into an excel file under a column without a name (column name is always on row 1 right?) ?
and also can I add a new column (while java program is running) by writing something (column name ) in row 1, any column and then update the newly "created" column?  or can I indicate specifically on what cell number I could write into?
How do you do it if it's possible?  I can't find it on the net.

Thanks a lot!
Question by:proxylaang
    LVL 9

    Expert Comment

    I think that you should import the spreadsheet into Access, MySQL, ... than use JDBC to manipulate the data,
    or use Apache POI library to manipulate your Excel data, change layout, etc.
    or use both of these to get what you want.

    Author Comment

    err I wouldn't like doing it all over again using POI or others besides the simple JDBC in java.  Unless there's a reason.
    points increased if anyone can help me
    LVL 9

    Accepted Solution

    I guess the poor documentation on it could  be a reason,

    you cannot indicate the cell number you want to write into :
    With JDBC you can only execute SQL queries, and they are limited :

    "[...] According to Microsoft, the Microsoft Excel ODBC driver does have some limitations. Specifically, the driver does not support DELETE, UPDATE, or ALTER TABLE statements. CREATE and INSERT statements are supported; just be sure to set up your data source as write-able. [...]"

    To add a column, you need an ALTER TABLE query, and as you can read, it is not supported by the ODBC driver.

    Another reason ...

    Assisted Solution


    To read/write to excel files try using the xlSQL library which can be found at

    Hope this helps.
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    advance java 4 36
    Issues installing SSL certificate into Apache Tomcat 3 49
    allStar challenge 1 27
    endX challenge 2 33
    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now