• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

error invalid column name

 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the following code



following error is coming


Connection Pooling Example.
An Error Had occurred while accessing the database
--------------------------------------------------------------------------------
Invalid column name



if i'm running this on oracle then it is giving output , i don't know why this is giving error while i'm running on server.

(I edited the code so that it wasn't far too wide -- Paul C)
 
Ranch Hand
Posts: 530
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that means one or some column names in the SELECT clause do not exist in the table. So check for typo in the column names.
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nam Ha Minh wrote:that means one or some column names in the SELECT clause do not exist in the table. So check for typo in the column names.



but the exact query running in the oracle so i don't think there is any prob like that that's why i mentioned that this query is running on oracle
 
Nam Ha Minh
Ranch Hand
Posts: 530
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cannot use the dot operator in the following statements:

 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nam Ha Minh wrote:You cannot use the dot operator in the following statements:



then what should i use to get value in the variable.
 
Sheriff
Posts: 26777
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nam Ha Minh wrote:You cannot use the dot operator in the following statements:



I don't know if that's right (I'm not an Oracle expert) but at any rate "DIV.R_DESG_NAME" isn't one of the fields selected. It's easy to miss the fact that "DES.R_DESG_NAME" is actually in the query instead.
 
Nam Ha Minh
Ranch Hand
Posts: 530
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Megha Singhal wrote:

then what should i use to get value in the variable.



One solution I would suggest you is to remove the table alias + dot + column name (if there is no conflict) in the SELECT clause, then update the code like this:



Or you can modify the SELECT clause using AS keyword to set alias for column names, i.e:



then in Java code:

 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nam Ha Minh wrote:

Megha Singhal wrote:

then what should i use to get value in the variable.



One solution I would suggest you is to remove the table alias + dot + column name (if there is no conflict) in the SELECT clause, then update the code like this:



Or you can modify the SELECT clause using AS keyword to set alias for column names, i.e:



then in Java code:



thanks it is working now.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic