Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8427141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:43:00+00:00 2026-06-10T04:43:00+00:00

I am buliding a stand alone application using java swing. and excel 2007 sheet

  • 0

I am buliding a stand alone application using java swing. and excel 2007 sheet as the backend for storing my data. There are 15 columns in the excel sheet. I am able to insert data into it with just 5 columns. But it shows “syntax error” when i try inserting 15 columns. Is there any limit on the the number of columns that can inserted at a time? or is there any other syntax for lengthy records? I am new to java. so kindly help me out. Thanks in advance 🙂 i have posted the part of the coding

 try
                       {

                         String value1=t1.getText();

                         String value2=(String)c6.getSelectedItem();

                         String value3=t3.getText();

                         String value4=t4.getText();

                         String value5=t5.getText();

                         String value6 = (String) c4.getSelectedItem(); 

                         String value7=t7.getText();

                         String value8=t8.getText();

                         String value9 = (String) c1.getSelectedItem(); 

                         String value10 = (String) c2.getSelectedItem(); 

                         String value11 = (String) c5.getSelectedItem(); 

                         String value12 = (String) c3.getSelectedItem(); 

                         String value13=t13.getText();

                         String value14=t14.getText();

                         String value15=t15.getText();

           //connection to the database          

                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
               Connection con=DriverManager.getConnection("jdbc:odbc:testingApp");

          //Execute some sql and load the records into the resultset
                  Statement st=con.createStatement();
                String q = "insert into [sheet1$] (CRN,CR_NUM,SOW_N,PSM,LBG,TYPE,VALUE,REMARKS,STATUS,APPROVAL,PLATFORM,MODEL,START_DATE,END_DATE,CUM_VALUE) values ('"+value1+"','"+value2+"','"+value3+"','"+value4+"','"+value5+"','"+value6+"','"+value7+"','"+value8+"','"+value9+"','"+value10+"','"+value11+"','"+value12+"','"+value13+"','"+value14+"','"+value15+"')";
                 int ds = st.executeUpdate(q);
                 System.out.println("Inserted Sucessfully...!!!");

                  /* t1.setText(null);
                    c6.addItem(null);
                    t3.setText(null);
                    t4.setText(null);
                    t5.setText(null);
                    c4.addItem(null);
                    t7.setText(null);
                    t8.setText(null);
                    c1.addItem(null);
                    c2.addItem(null);
                    c5.addItem(null);
                    c3.addItem(null); 
                    t13.setText(null);
                    t14.setText(null);
                    t15.setText(null); */
                    }catch(Exception e)
                       {
                           System.out.println(e.getMessage());
                        }
                    }

} 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:43:01+00:00Added an answer on June 10, 2026 at 4:43 am

    If you want to have xls/xlsx format then as sp00m sai, Apache POI is best solution,
    if you want to have csv file, then just create text file and write there data separating columns with comma and rows with “\n” character

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a stand alone application using java swing and I am using
Building a stand alone WPF application that uses a MSSQL backend. I would like
I am currently building an application using ASP.NET MVC. The data entry pages are
We have jboss logging enabled in our application. Currently we are using the 'Rotating-file-handler'
We are currently using SVN to develop an internal application that has most of
I am building an android application and want to know if there is a
I'm building an application that serves up data to a standalone Google Earth client.
I am building a web application with a backend restful web service. One of
building a site using PHP and MySQL that needs to store a lot of
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.