commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@mwm.lt>
Subject Re: [dbutils] patch to DbUtils
Date Wed, 12 Mar 2003 08:53:14 GMT
Thanks,
I will fix this.
----- Original Message -----
From: "george stewart" <gstewart@us-south.net>
To: <commons-dev@jakarta.apache.org>
Sent: Tuesday, March 11, 2003 10:37 PM
Subject: [dbutils] patch to DbUtils


> rethrow doesn't guard against null vals.  The method fillStatement does.
>
> Index: DbUtils.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/
dbutils/DbUtils.java,v
> retrieving revision 1.14
> diff -u -r1.14 DbUtils.java
> --- DbUtils.java 10 Mar 2003 19:35:42 -0000 1.14
> +++ DbUtils.java 11 Mar 2003 21:34:56 -0000
> @@ -155,10 +155,12 @@
>      }
>
>      static void rethrow(SQLException cause, String sql,Object[]
vals )throws SQLException{
> -
> -        String msg = cause.getMessage() + " in query " + sql +
> -        java.util.Arrays.asList(vals).toString();
> -        SQLException newsqle = new SQLException(msg);
> +        StringBuffer msg =
> +            new StringBuffer(cause.getMessage() + " in query " + sql);
> +        if (vals != null) {
> +            msg.append(java.util.Arrays.asList(vals).toString());
> +        }
> +        SQLException newsqle = new SQLException(msg.toString());
>          newsqle.setNextException(cause);
>          throw newsqle;
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>


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


Mime
View raw message