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

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!
Who is Participating?
matthew016Connect With a Mentor Commented:
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 ...
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.
proxylaangAuthor Commented:
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
BNgureConnect With a Mentor Commented:

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

Hope this helps.
Forced accept.

EE Admin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.