Retrieve Sybase-Specific Error Information

jConnect provides an EedInfo interface that specifies methods for obtaining Sybase-specific error information.

The EedInfo interface is implemented in SybSQLException and SybSQLWarning, which extend the SQLException and SQLWarning classes.

SybSQLException and SybSQLWarning contain these methods:
  • public ResultSet getEedParams, which returns a one-row result set containing any parameter values that accompany the error message.

  • public int getStatus, which returns a 1 if there are parameter values, and returns a 0 if there are no parameter values in the message.

  • public int getLineNumber, which returns the line number of the stored procedure or query that caused the error message.

  • public String getProcedureName, which returns the name of the procedure that caused the error message.

  • public String getServerName, which returns the name of the server that generated the message.

  • public int getSeverity, which returns the severity of the error message.

  • public int getState, which returns information about the internal source of the error message in the server for use only by Sybase Technical Support.

  • public int getTranState, which returns one of the following transaction states:
    • 0 – the connection is currently in an extended transaction.

    • 1 – the previous transaction committed successfully.

    • 3 – the previous transaction aborted.

Some error messages can be SQLException or SQLWarning messages without being SybSQLException or SybSQLWarning messages. Your application should check the type of exception it is handling before it downcasts to SybSQLException or SybSQLWarning.