I,m using the last trial version of the driver on a Mac OS X 10.3.9, the database is MS Access 97. I,m getting the next exception:
java.sql.SQLException: Invalid column: bomId
at com.hxtt.global.SQLState.SQLException(Unknown Source)
at com.hxtt.sql.cl.a(Unknown Source)
at com.hxtt.sql.cl.a(Unknown Source)
at com.hxtt.sql.cl.a(Unknown Source)
at com.hxtt.sql.cl.a(Unknown Source)
at com.hxtt.sql.a7.a(Unknown Source)
at com.hxtt.sql.a7.a(Unknown Source)
at com.hxtt.sql.y.a(Unknown Source)
at com.hxtt.sql.cm.executeQuery(Unknown Source)
The SQL statement that produces this exception is:
PreparedStatement stm = conn.prepareStatement("SELECT MAX(bomId) FROM bom");
ResultSet rs = stm.executeQuery();
I've checked the database and the column bomId exists on that table. The application originally works with PostgreSQL and everything worked fine with the JDBC driver for that db. I'm moving to Access because our client requested.
Thanks in advance.
|
It means that HXTT Access failed to find that column. You can try:
ResultSet rs = stmt.executeQuery(("SELECT top 1 * FROM bom");
ResultSetMetaData resultSetMetaData = rs.getMetaData();
int iNumCols = resultSetMetaData.getColumnCount();
for (int j = 1; j <= iNumCols; j++){
System.out.printlnresultSetMetaData.getColumnLabel(j));
}
to print all column names, then you can find the true name of bomId column. If you think that true name of bomId is wrong, you can email your sampe mdb to webmaster@hxtt.com .
|