commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bali...@apache.org
Subject cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils Demo.java
Date Fri, 14 Mar 2003 17:27:37 GMT
baliuka     2003/03/14 09:27:35

  Modified:    dbutils/src/java/org/apache/commons/dbutils DbUtils.java
                        ProcedureUtils.java
               dbutils/src/test/org/apache/commons/dbutils Demo.java
  Log:
  fixed bug in ProcedureUtils
  
  Revision  Changes    Path
  1.17      +8 -16     jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/DbUtils.java
  
  Index: DbUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/DbUtils.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DbUtils.java	12 Mar 2003 22:29:05 -0000	1.16
  +++ DbUtils.java	14 Mar 2003 17:27:32 -0000	1.17
  @@ -169,26 +169,18 @@
       }
       
       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);
  -        newsqle.setNextException(cause);
  -        throw newsqle;
  -        
  -    }
       
  -    static void throwNoResults( String sql,Object[] vals )throws SQLException{
  -        
  -        rethrow( new SQLException("No results returned"), sql, vals );
  +       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;
           
       }
       
  -    static void throwMultipleResults( String sql,Object[] vals )throws SQLException{
  -        
  -        rethrow( new SQLException("No results returned"), sql, vals );
  -        
  -    }
       
       
       
  
  
  
  1.8       +2 -1      jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/ProcedureUtils.java
  
  Index: ProcedureUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/ProcedureUtils.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ProcedureUtils.java	11 Mar 2003 18:57:47 -0000	1.7
  +++ ProcedureUtils.java	14 Mar 2003 17:27:33 -0000	1.8
  @@ -196,6 +196,7 @@
       static Method findMethod(Class cls, JavaMethod jmethod){
           
           Method methods[] = cls.getDeclaredMethods();
  +        LOOP:
           for(int i=0; i< methods.length; i++ ){
               
               if(methods[i].getName().equals(jmethod.getName()) ){
  @@ -208,7 +209,7 @@
                       for( int j = 0; j < params.length; j++ ){
                           
                           if(!params[j].getName().equals(jparams[j].getType().getValue())
){
  -                            continue;
  +                            continue LOOP;
                           }
                           
                       }
  
  
  
  1.7       +1 -1      jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/Demo.java
  
  Index: Demo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/Demo.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Demo.java	11 Mar 2003 18:57:47 -0000	1.6
  +++ Demo.java	14 Mar 2003 17:27:35 -0000	1.7
  @@ -47,7 +47,7 @@
        *@handler DemoHandler
        */
       public int dynamicPrint(java.io.PrintStream out,
  -                            String table, String field, int value) ;
  +                            String table, String field, int value);
       
       
       
  
  
  

---------------------------------------------------------------------
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