Oh God. Thank you God. I solved the problem by enclosing the column name in quotation marks "SELECT * FROM document WHERE 'reassign_documents_primary_key_col'=2". IT IS AN UNBELIEVABLE MYSTERY.
In the code below, the line
is throwing an SQL exception : "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1."
The problem is that the code works for many tables:
SELECT * FROM user
SELECT * FROM control
SELECT * FROM document
SELECT * FROM document WHERE assigned_documents_primary_key_col=2
SELECT * FROM document WHERE initiated_documents_primary_key_col=2
But fails for "SELECT * FROM document WHERE documents_to_assign_primary_key_col=2". The exact same
string executes directly in MS Access and the column documents_to_assign_primary_key_col exists in the table.
There is more to the problem: If I run a static method from a
test class calling the method getObjectsRowSet above, everything works fine.
When this runs I get
SELECT * FROM user
SELECT * FROM control
SELECT * FROM document
SELECT * FROM document WHERE assigned_documents_primary_key_col=2
SELECT * FROM document WHERE initiated_documents_primary_key_col=2
SELECT * FROM document WHERE reassign_documents_primary_key_col=2
Success