Skip to content

Commit

Permalink
JDBC-192: add SQLstate for incorrect generated keys option
Browse files Browse the repository at this point in the history
  • Loading branch information
mrotteveel committed Dec 17, 2011
1 parent 6d04361 commit 75783f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -89,8 +89,7 @@ public AbstractGeneratedKeysQuery(String sql, int autoGeneratedKeys) throws SQLE
if (autoGeneratedKeys == Statement.RETURN_GENERATED_KEYS) {
queryType = QUERY_TYPE_ADD_ALL_COLUMNS;
} else if (autoGeneratedKeys != Statement.NO_GENERATED_KEYS) {
// TODO Add correct SQL State
throw new FBSQLException("Supplied value for autoGeneratedKeys is invalid");
throw new FBSQLException("Supplied value for autoGeneratedKeys is invalid", FBSQLException.SQL_STATE_INVALID_OPTION_IDENTIFIER);
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/org/firebirdsql/jdbc/FBSQLException.java
Expand Up @@ -35,8 +35,10 @@ public class FBSQLException extends SQLException {

public static final String SQL_STATE_GENERAL_ERROR = "HY000";
public static final String SQL_STATE_INVALID_COLUMN = "HY002";
public static final String SQL_STATE_INVALID_PARAM_TYPE = "HY105";
public static final String SQL_STATE_INVALID_ARG_VALUE = "HY009";
public static final String SQL_STATE_INVALID_OPTION_IDENTIFIER = "HY092";
public static final String SQL_STATE_INVALID_PARAM_TYPE = "HY105";


public static final String SQL_STATE_WRONG_PARAM_NUM = "07001";
public static final String SQL_STATE_NO_RESULT_SET = "07005";
Expand Down

0 comments on commit 75783f8

Please sign in to comment.