I have the following diagnostic sql statementselect * from MachineShift WHERE ShiftID = 'D' And MachineID='F22'
Originally, I had this: select HoursRunning from MachineShift where ShiftID = 'D' and MachineID = 'F22' and MachineDate = 2014/01/01
. However, I got the error of 'too few parameters'. specifically for HoursRunning and MachineDate.
The table: MachinShift (MachineID,ShiftID,OperatorID,HoursRunning,MachineDate)
After using some sample code I found in another stackoverflow question, I managed to figure out that the java program itself is not seeing those two columns (HoursRunning and MachineDate).
Here's the troubleshooting stuff:
After using this code:
ResultSetMetaData rsmd = rs.getMetaData();
System.out.println(rsmd.getColumnName(1));
System.out.println(rsmd.getColumnName(2));
System.out.println(rsmd.getColumnName(3));
System.out.println(rsmd.getColumnName(4));
System.out.println(rsmd.getColumnName(5));
I got only these 3 columns. MachineID ShiftID OperatorID
Then an error saying 'Invalid Descriptor index' which I assume means that there were no more columns to find.
I've never encountered this sort of error before. The sql statement that I originally wanted to use worked perfectly when I executed it with MS Access, but as soon as I used the java program to retrieve or update data, it could not find these columns. I would also like to add that a month ago, the java program was working fine and it was extracting and updating data from this table as well as others without a problem.
Is this some sort of tabulation problem? I have restarted my pc thinking Access might need to update some sort of registry, but the problem persisted through all that. I've also tried name changes, rebuilding the tables from scratch etc.