Java and MS SQL Server 2000 problem, please help

please help me. I am using java and MS SQL Server 2000, and I'm trying to access and verify the login. I'm getting the following error message: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index

Can any please help in this regard.

String userNumber = (String)userNumField.getValue();

char[] userPasswordArray = userPasswordField.getPassword();

String userPassword =new String(userPasswordArray);

try{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:odbc:Dikolobe_Data");

java.sql.PreparedStatement statement = connection.prepareStatement(

"SELECT USER_NUMBER, USER_PASSWORD, USER_CLASS, USER_STATUS " +

"FROM SYS_USER " +

"WHERE (USER_NUMBER = ? AND USER_PASSWORD = ?);");

statement.setString(1, userNumber);

statement.setString(2, userPassword);

java.sql.ResultSet result = statement.executeQuery();

if(result.next()){

String userStatus = result.getString(4);

if(userStatus.equals("logged on")){

String loginErrorMessage ="User with number: " + userNumber +" is already logged on.";

javax.swing.JOptionPane loginErrorPane = getNarrowOptionPane(72);

loginErrorPane.setMessage(loginErrorMessage);

loginErrorPane.setMessageType(javax.swing.JOptionPane.ERROR_MESSAGE);

javax.swing.JDialog loginErrorDialog = loginErrorPane.createDialog(null,"Login Error");

loginErrorDialog.setVisible(true);

}

else{

String userClassification = result.getString(3);

if(userClassification.equals("Administrator")){

AdminHomePage newAdminHomePage =new AdminHomePage();

newAdminHomePage.setVisible(true);

}

elseif(userClassification.equals("Educator")){

EduHomePage newEduHomePage =new EduHomePage();

newEduHomePage.setVisible(true);

}

statement = connection.prepareStatement(

"UPDATE SYS_USER SET USER_STATUS = ? " +

"WHERE USER_NUMBER = ?");

statement.setString(1,"logged on");

statement.setString(2, userNumber);

statement.executeUpdate();

dispose();

}

}

[3300 byte] By [Maba@ULa] at [2007-11-27 10:02:20]
# 1
Doesn't the following link give you enough information? http://www.google.com/search?q=invalid+descriptor+indexAnyway .. This error means that the given ResultSet column index which you're trying to retrieve the value from is out of the range.
BalusCa at 2007-7-13 0:36:38 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
The site given above was usefull. I was able to fix my problemthanks
Maba@ULa at 2007-7-13 0:36:38 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
www.google.com is indeed useful. However, I'm amazed that you seem to never know from this site before?
BalusCa at 2007-7-13 0:36:38 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...