Can anyone tell me why the following code produces an invalid descriptor index error? I have a SQL statement that returns 1 row with two columns: time, event. Then I have 2 vectors:
Vector time = new Vector();
Vector event = new Vector();
int x = 0;
double v = 0;
while (rs1.next()){
x = rs1.getInt("Event"
;
v = rs1.getDouble("Time"
;
time.addElement(Integer.toString(x));
event.addElement(Double.toString(v));}
NumEngages.close();
If I take one of the vectors out I'm fine, but I don't think it should be that way. It seems like after it retrieves the event it moves on to the next row before I can retrieve the time. Does anyone know how to combat this.
Vector time = new Vector();
Vector event = new Vector();
int x = 0;
double v = 0;
while (rs1.next()){
x = rs1.getInt("Event"
v = rs1.getDouble("Time"
time.addElement(Integer.toString(x));
event.addElement(Double.toString(v));}
NumEngages.close();
If I take one of the vectors out I'm fine, but I don't think it should be that way. It seems like after it retrieves the event it moves on to the next row before I can retrieve the time. Does anyone know how to combat this.