Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

View Poll Results: poll me

Voters
0. You may not vote on this poll
  • How to solve this problem

    0 0%
  • what is the best way to do this

    0 0%
Multiple Choice Poll.
Results 1 to 2 of 2

Thread: Read (using Odbc)and write using (POI api)

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Read (using Odbc)and write using (POI api)

    Hi ALL,
    I tried to to read and write the data through excel files.But i am facing some issues while reading and writting the data.The exceptions which are coming are mentioned below
    __________________________________________________ _________________________________
    Exception:

    sqlselect 'villno','fno','w_name', 'age','idno','adcode','caste','educ','height' from [studyhb$]
    java.sql.SQLException: Column not found
    at sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(Unknown Source)roundSQL
    select `month1`,`year1`,`round1`, `ttab1`,`teat1`,`m_wt1`,`m_pre1`, `eff11`,`eff12`,`eff13`,`hedu1`,`other1` from [studyhb$] where villno='' and fno='' and w_name='' and idno=''

    at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
    at db.ReadOdbc.WriteFirstRowOfInputSheet(ReadOdbc.jav a:283)
    at db.ReadOdbc.main(ReadOdbc.java:66)
    java.sql.SQLException: Column not found
    at sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
    at db.ReadOdbc.GetSQLString(ReadOdbc.java:240)
    at db.ReadOdbc.WriteFirstRowOfInputSheet(ReadOdbc.jav a:300)
    at db.ReadOdbc.main(ReadOdbc.java:66)
    java.sql.SQLException: [Microsoft][ODBC Excel Driver] Data type mismatch in criteria expression.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(Unkno wn Source)
    at db.ReadOdbc.WriteFirstRowOfInputSheet(ReadOdbc.jav a:305)
    at db.ReadOdbc.main(ReadOdbc.java:66)
    java.lang.NullPointerException
    __________________________________________________ _______________________________

    I want that the data i am reading should be wriiten in excellsheet(output).The write file is now writting only headers.
    Please guide me how to do this
    Attached Files Attached Files


  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,102
    Thanks
    169
    Thanked 779 Times in 725 Posts
    Blog Entries
    5

    Default Re: Read (using Odbc)and write using (POI api)

    Please post the code in a new post (flanked by the [highlight=java][/highlight] tags). Few users will actually download the attachment and open it. And is there any reason this is marked as a poll?

Similar Threads

  1. Images (read/write, drawing)
    By helloworld922 in forum File Input/Output Tutorials
    Replies: 1
    Last Post: September 5th, 2011, 09:11 AM
  2. Cannot locate sun.jdbc.odbc.jbcOdbc driver
    By birdlover2010 in forum JDBC & Databases
    Replies: 7
    Last Post: November 6th, 2010, 02:57 PM
  3. Project using JavaBeans, JSP & ODBC.
    By m.b.taylor in forum Paid Java Projects
    Replies: 0
    Last Post: July 15th, 2010, 09:36 AM
  4. How to Write and Read Binary Data
    By neo_2010 in forum File Input/Output Tutorials
    Replies: 3
    Last Post: January 4th, 2010, 01:38 PM
  5. Replies: 6
    Last Post: August 30th, 2009, 04:31 AM