• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception thrown is "Column xxxx unknown in field list"...even though the code is running..!!!

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am executing query:


I am executing the above query using jdbc. The code is running, data is being saved bt SQLexception I am getting is :

Column No_Reading is not found in the field list.

What can be the cause of above exception??
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suppose this is mysql database, anyways, can you put 97 in single quotes to see if it works. But you should use PreparedStatement and proper setXXX methods.
 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I edited your post, to wrap the very long lines.
This type of message generally means you forgot to put quotes around one of the "no reading" strings in your SQL
It would be nice if you could produce a test program, thst just does the insert, so we can see the full stack trace and the actual line it refers to.
 
Kshitiz Agarwal
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Wendy Gibbons wrote:I edited your post, to wrap the very long lines.
This type of message generally means you forgot to put quotes around one of the "no reading" strings in your SQL
It would be nice if you could produce a test program, thst just does the insert, so we can see the full stack trace and the actual line it refers to.



Thanks for the reply...but as I am creating a query dynamically, quotes are not missed out around any "No Reading" value. I am trying to use prepared statement anyway...!!!
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ksh agarwal wrote:

Wendy Gibbons wrote:I edited your post, to wrap the very long lines.
This type of message generally means you forgot to put quotes around one of the "no reading" strings in your SQL
It would be nice if you could produce a test program, thst just does the insert, so we can see the full stack trace and the actual line it refers to.



Thanks for the reply...but as I am creating a query dynamically, quotes are not missed out around any "No Reading" value. I am trying to use prepared statement anyway...!!!



well it is very difficult for us to help if we aren't even given the code you are running
 
Kshitiz Agarwal
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Wendy Gibbons wrote:

ksh agarwal wrote:

Wendy Gibbons wrote:I edited your post, to wrap the very long lines.
This type of message generally means you forgot to put quotes around one of the "no reading" strings in your SQL
It would be nice if you could produce a test program, thst just does the insert, so we can see the full stack trace and the actual line it refers to.



Thanks for the reply...but as I am creating a query dynamically, quotes are not missed out around any "No Reading" value. I am trying to use prepared statement anyway...!!!



well it is very difficult for us to help if we aren't even given the code you are running



Ohh..sorry...this is my code basically:



And even prepared statament is not solving the issu..though i will be using it for safer purpose..

The error is Unknown column 'No_Reading' in 'field list' >
 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ksh agarwal wrote:
Ohh..sorry...this is my code basically:



OK,
And now please insert into this code in line #22 the below command:

then run the code and show us the output of this command (the query created by your code).
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ireneusz Kordal wrote:

ksh agarwal wrote:
Ohh..sorry...this is my code basically:



OK,
And now please insert into this code in line #22 the below command:

then run the code and show us the output of this command (the query created by your code).



and the stack trace, as if the insert is working, i think another line may be throwing the error, but you are missing that.
 
Kshitiz Agarwal
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Wendy Gibbons wrote:

Ireneusz Kordal wrote:

ksh agarwal wrote:
Ohh..sorry...this is my code basically:



OK,
And now please insert into this code in line #22 the below command:

then run the code and show us the output of this command (the query created by your code).



and the stack trace, as if the insert is working, i think another line may be throwing the error, but you are missing that.



May be you are right...actually I am getting an exception:

Operation not allowed after ResultSet closed

In code :

The above function is called aftre every 10 secs and connection to jdbc is made once only. The error comes in //ERROR part of the code. Because of which nullpointerexception also comes in the next line. Why it is coming if I have used If condition before going to while loop???
 
reply
    Bookmark Topic Watch Topic
  • New Topic