commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [DBCP] PStmtKey ctors have multiple int paramaters - replace with enums?
Date Wed, 05 Feb 2014 16:38:56 GMT
On 5 February 2014 15:55, sebb <sebbaz@gmail.com> wrote:
> The PStmtKey ctors have multiple int parameters:
>
> PStmtKey(String sql, int resultSetType, int resultSetConcurrency)
> PStmtKey(String sql, String catalog, int autoGeneratedKeys) {
> PStmtKey(String sql, String catalog, int resultSetType, int
> resultSetConcurrency)
> public PStmtKey(String sql, String catalog, int resultSetType, int
> resultSetConcurrency, StatementType stmtType)
>
> and
>
> PStmtKey(String sql, String catalog, StatementType stmtType, Integer
> autoGeneratedKeys)
>
> if you count autoboxed code.
>
> These are quite confusing.
> Maybe some or all could be replaced with enums?
>
> resultSetType can only be
>
> ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or
> ResultSet.TYPE_SCROLL_SENSITIVE
>
> and resultSetConcurrency can only be
>
> ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE

Also, autoGeneratedKeys can only be:

Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message