To determine the exact location of a syntax error, use the getSQLStatementOffset() method to return the syntax error offset.
The following example shows how to retrieve the syntax error offset from an SQL statement (which is 10 in this example):
try { Statement stmt = conn.createStatement(); String command = "select * fom tt"; stmt.execute( command ); } catch(Exception e) { System.out.println ("Error Offset :"+((IfmxConnection conn).getSQLStatementOffset() ); System.out.println(e.getMessage() ); }
RSAM messages are attached to SQLCODE messages. For example, if an SQLCODE message says that a table cannot be created, the RSAM message states the reason, which might be insufficient disk space.
You can use the SQLException.getNextException() method to catch RSAM error messages. For an example of how to catch these messages, see the ErrorHandling.java program, which is included in IBM Informix JDBC Driver.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]