Anyone help with this one - I'm sure it's easy.
I have a working bean for a jsp where the statement sent to the QUERY is >> private String "SELECT * FROM mytablename ORDER BY afieldname <<. It works fine and there's no overt problems. But I dont want to return all the >> hasNext in the resultSet rs << To see the working example of why, log in at www.klaatu2u.com and go to the "ballets" menu item.
I'm trying to modify the query string to
private String "SELECT DISTINCT afieldname FROM mytablename ORDER BY afieldname " << and it's giving me a column index out of range error 3 > 1 error. As far as I can tell this comes from the resultset class in the see here below
//error i keep getting...from mysql/jdbc2/
// if (columnIndex < 1 || columnIndex > Fields.length) {
// throw new java.sql.SQLException("Column Index out of range ( " + columnIndex + " > " + Fields.length + ").", "S1002");
// }
At any rate it is erroring on my mod'd query string. No clue as to why it wont see the column index properly. I have tried "SELECT DISTINCT afieldname FROM tablename WHERE afieldname = '*' " and it doesnt give the error, just no resultset.
I'm using NETBEANS for my compiler :-/ , and mysql connector-j. I'm doing a lot of other fun stuff with it (stringtokenizing data for SPEED!) and all works well - just the DISTINCT myfieldname is no-go.
No I'm not to smart - but could sure use help anyway. Thanx much for anyone who responds...