• Post Reply Bookmark Topic Watch Topic
  • New Topic

jdbc: invalid column number  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using win 98/ jdk1.2.2/and oracle odbc driver.
the database is oracle8i.
i have no idea as to what kind of driver it is.
here is my problem.
i have the same tables in MSaccess and oracle.
the program works fine with access. but, with oracle i have a strange problem.
java.sql.exception:Invalid colum number<1>
please help..
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At first glance it sound as thou you might have a typo...
Check you connection reference variables.
If it is not a type....
Please post code along with table layouts.
I have access to a NT box JDK1.3 JDBC 2.0 MS-ACCESS 2.0 and ORACLe 7.3.4
ttyl, Monty
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When does the problem occur? DUring what operation? Have you isolated that? Is the column reference refering to a ResultSet or ResultSetMetaData? Or is it a Statment, Prepared Statement, or Callable Statement? Where in your code does the error happen?
Phil
 
purnima das
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for not giving details.
i was trying to fetch data from the database using Statement interface.
i've made a mistake in the order of retrival of columns.
i changed the order and got the result.
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the java.sql.ResultSet javadoc...
"For maximum portability, result set columns within each row should be read in left-to-right order, and each column should be read only once."
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is only required when needing portability to JDBC 1.0 drivers (though it may give some performance benefit depending on how the individual drivers are coded).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!