Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query with column rename not working! (SQLServer/JDBC-ODBC bridge)

843854Jul 2 2004 — edited Jul 2 2004
Hi,

I was wondering if anybody could help. I am translating some stuff from ASP to JSP and ran into an SQL query that goes like this:

String SQLQuery = "SELECT myTable.myColumn renamedColumn FROM myTable";

which is perfectly legal in SQL Server. I get the stuff from myTable, no problem, and the column's name is locally indeed renamedColumn.

Under the sun.jdbc.odbc.JdbcOdbcDriver, however, trying to do something like:

string myResult = results.getString("renamedColumn");

throws an SQL exception with the message "Index not found".

And if I don't rename the column and try:

myResult = results.getString("myTable.myColumn");

also gives the same problem.

Anybody know what to do?

[P.S, the reason why I have to rename my column is because I have two tables with an identical column name and need both for a search page]
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 30 2004
Added on Jul 2 2004
1 comment
262 views