avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/test Tester.java
Date Mon, 12 Nov 2001 20:03:22 GMT
hammant     01/11/12 12:03:22

  Modified:    apps/db/src/java/org/apache/avalon/db/basic/actions
                        BasicSelect.java
               apps/db/src/java/org/apache/avalon/db/basic/data
                        BasicRow.java BasicTable.java
               apps/db/src/java/org/apache/avalon/db/test Tester.java
  Log:
  small changes to Select
  
  Revision  Changes    Path
  1.11      +1 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicSelect.java
  
  Index: BasicSelect.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicSelect.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BasicSelect.java	2001/11/12 18:09:43	1.10
  +++ BasicSelect.java	2001/11/12 20:03:21	1.11
  @@ -187,7 +187,7 @@
           }
           this.parseWhereTerm((Element)whereElement.getFirstChild(),sb);
           System.out.println("parseWhereRoot(): END");
  -        System.out.println("sb=" + sb);
  +        System.out.println("sb=[" + sb + "]");
           return sb;
       }
   
  
  
  
  1.6       +1 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/data/BasicRow.java
  
  Index: BasicRow.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/data/BasicRow.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BasicRow.java	2001/11/12 13:28:26	1.5
  +++ BasicRow.java	2001/11/12 20:03:22	1.6
  @@ -48,6 +48,6 @@
       }
   
       public Object getValue(int idx) {
  -        return mRow.elementAt(idx-1);
  +        return mRow.elementAt(idx);
       }
   }
  
  
  
  1.5       +3 -2      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/data/BasicTable.java
  
  Index: BasicTable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/data/BasicTable.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BasicTable.java	2001/11/09 17:42:27	1.4
  +++ BasicTable.java	2001/11/12 20:03:22	1.5
  @@ -23,8 +23,9 @@
                   return x;
               }
           }
  -        System.out.println("Whoa " + columnName + " not found");
  -        return -1;
  +        throw new RuntimeException("Column " + columnName + " not found");
  +        //System.out.println("Whoa " + columnName + " not found");
  +        //return -1;
       }
   
   
  
  
  
  1.12      +7 -6      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/test/Tester.java
  
  Index: Tester.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/test/Tester.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Tester.java	2001/11/12 13:29:29	1.11
  +++ Tester.java	2001/11/12 20:03:22	1.12
  @@ -61,19 +61,20 @@
           System.err.println("SELECT 1");
           st = mCon.createStatement();
           String select = "<simple-select>" +
  -                            "<columns>*</columns>" +
  -                            "<from><table name=\"Flintstones\"/></from>"
+
  +                           "<columns>*</columns>" +
  +                           "<from><table name=\"Flintstones\"/></from>"
+
                              "<where>" +
  -                           "<and>" +
  -                            "</and>" +
  -                            "</where>" +
  +                             "<and>" +
  +                               "<condition expr=\"row.getColumn('forename').equals('Fred')\"/>"
+  //TODO this is too Java
  +                             "</and>" +
  +                           "</where>" +
                           "</simple-select>";
   
           ResultSet rs = st.executeQuery(select);
           st.close();
           while (rs.next()) {
  +            System.out.println("Result col0 = " + rs.getString(0));
               System.out.println("Result col1 = " + rs.getString(1));
  -            System.out.println("Result col2 = " + rs.getString(2));
           }
   
           /*
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message