commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/sql QueryTag.java
Date Tue, 21 May 2002 19:36:57 GMT
jstrachan    02/05/21 12:36:57

  Modified:    jelly    build.xml project.xml
               jelly/src/java/org/apache/commons/jelly/tags/sql
                        QueryTag.java
  Removed:     jelly    build-old.xml .build.properties
               jelly/src/test/org/apache/commons/jelly/sql example3.jelly
  Log:
  Imported the old build targets from the old pre-Maven build so that the SQL scripts can
now be run properly. For example
  
  ant demo.sql
  
  will run various example SQL scripts on a database (using Ant properties to connect) and
generate some XML documents in the target directory.
  
  Revision  Changes    Path
  1.24      +20 -42    jakarta-commons-sandbox/jelly/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/build.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- build.xml	21 May 2002 16:53:26 -0000	1.23
  +++ build.xml	21 May 2002 19:36:56 -0000	1.24
  @@ -5,34 +5,32 @@
     <!-- Give user a chance to override without editing this file
          (and without typing -D each time they invoke a target) -->
   
  -  <!-- Allow any user specific values to override the defaults -->
  +  <!-- Allow any user specific values to override the defaults -->  
     <property file="${user.home}/build.properties" />
  +  
     <!-- Allow user defaults for this project -->
     <property file="build.properties" />
  +  
     <!-- Set default values for the build -->
     <property file="project.properties" />
     
     <!-- the default build location -->
     <property name="maven.build.dest" value="target/classes"/>
   
  -  	  <path id="test.classpath">
  -        <pathelement path="${maven.build.dest}"/>
  -        <pathelement location="${lib.repo}/commons-logging-1.0.jar"/>
  -        <pathelement location="${lib.repo}/commons-beanutils-20020520.jar"/>
  -        <pathelement location="${lib.repo}/commons-collections-2.0.jar"/>
  -        <pathelement location="${lib.repo}/commons-digester-1.2.jar"/>
  -        <pathelement location="${lib.repo}/commons-jexl-1.0-dev.jar"/>
  -        <pathelement location="${lib.repo}/dom4j-1.4-dev.jar"/>
  -        <pathelement location="${lib.repo}/hsqldb.jar"/>
  -        <pathelement location="${lib.repo}/velocity-1.4-dev.jar"/>
  -        <pathelement location="/jpackages/jaxp-1.1/jaxp.jar"/>
  -        <pathelement location="/jpackages/jaxp-1.1/crimson.jar"/>
  -<!--        
  -        <pathelement location="${lib.repo}/xmlParserAPIs-2.0.0.jar"/>
  -        <pathelement location="${lib.repo}/xercesImpl-2.0.0.jar"/>
  --->        
  -        <pathelement location="${lib.repo}/jdbc2_0-stdext.jar"/>
  -      </path>
  +  <path id="test.classpath">
  +    <pathelement path="${maven.build.dest}"/>
  +    <pathelement location="${lib.repo}/commons-logging-1.0.jar"/>
  +    <pathelement location="${lib.repo}/commons-beanutils-20020520.jar"/>
  +    <pathelement location="${lib.repo}/commons-collections-2.0.jar"/>
  +    <pathelement location="${lib.repo}/commons-digester-1.2.jar"/>
  +    <pathelement location="${lib.repo}/commons-jexl-1.0-dev.jar"/>
  +    <pathelement location="${lib.repo}/dom4j-1.4-dev.jar"/>
  +    <pathelement location="${lib.repo}/hsqldb-1.7.0.jar"/>
  +    <pathelement location="${lib.repo}/velocity-1.4-dev.jar"/>
  +    <pathelement location="${lib.repo}/xmlParserAPIs-2.0.0.jar"/>
  +    <pathelement location="${lib.repo}/xercesImpl-2.0.0.jar"/>
  +    <pathelement location="${lib.repo}/jdbc2_0-stdext.jar"/>
  +  </path>
   
     <!-- maven:start -->
     
  @@ -228,31 +226,11 @@
   	  <property name="databaseUser"            value="sa"/>
   	  <property name="databaseTable"           value="SYSTEM_TABLES"/>
   
  -	<echo message="Running example 3"/>
  -
  -<!--	
  -    <java classname="org.apache.commons.jelly.Jelly" fork="yes">
  -      <classpath refid="test.classpath"/>
  -      <arg value="src/test/org/apache/commons/jelly/sql/example3.jelly"/> 
  -      <sysproperty key="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
  -    </java>
  --->
  -    
  -    <taskdef
  -      name="jelly"
  -      classname="org.apache.commons.jelly.task.JellyTask">
  -      <classpath refid="test.classpath"/>
  -    </taskdef>
  -    
  -	<echo message="Running example"/>
  +	<echo message="Running examples and outputting results to target directory"/>
   	
  -	<jelly file="src/test/org/apache/commons/jelly/sql/example3.jelly" output="target/sqloutput.xml"/>
   	<jelly file="src/test/org/apache/commons/jelly/sql/example.jelly" output="target/sqloutput.xml"/>
  -<!--
  -	<jelly file="src/test/org/apache/commons/jelly/sql/example.jelly" output="${maven.build.dest}/sqloutput.xml"/>
  -	<jelly file="src/test/org/apache/commons/jelly/sql/example2.jelly" output="${maven.build.dest}/sqloutput2.xml"/>

  -	<jelly file="src/test/org/apache/commons/jelly/sql/testSql.jelly" output="${maven.build.dest}/sqloutput3.xml"/>

  --->	
  +	<jelly file="src/test/org/apache/commons/jelly/sql/example2.jelly" output="target/sqloutput2.xml"/>

  +	<jelly file="src/test/org/apache/commons/jelly/sql/testSql.jelly" output="target/sqloutput3.xml"/>
	
      </target>
      
   	
  
  
  
  1.4       +14 -0     jakarta-commons-sandbox/jelly/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml	21 May 2002 16:53:26 -0000	1.3
  +++ project.xml	21 May 2002 19:36:56 -0000	1.4
  @@ -112,6 +112,20 @@
         <jar>hsqldb-1.7.0.jar</jar>
       </dependency>
   
  +    <dependency>
  +      <name>xercesImpl</name>
  +      <type>required</type>
  +      <version>2.0.0</version>
  +      <jar>xercesImpl-2.0.0.jar</jar>
  +    </dependency>
  +
  +    <dependency>
  +      <name>xmlParseAPIs</name>
  +      <type>required</type>
  +      <version>2.0.0</version>
  +      <jar>xmlParserAPIs-2.0.0.jar</jar>
  +    </dependency>
  +
     </dependencies>
     
     <build>
  
  
  
  1.7       +4 -6      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/sql/QueryTag.java
  
  Index: QueryTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/sql/QueryTag.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- QueryTag.java	21 May 2002 16:53:26 -0000	1.6
  +++ QueryTag.java	21 May 2002 19:36:56 -0000	1.7
  @@ -219,7 +219,7 @@
           Result result = null;
           String sqlStatement = null;
   
  -        log.info( "About to lookup connection" );
  +        log.debug( "About to lookup connection" );
           
           try {
               conn = getConnection();
  @@ -254,16 +254,14 @@
               PreparedStatement ps = conn.prepareStatement(sqlStatement);
               setParameters(ps, parameters);
               
  -            log.info( "About to execute query: " + sqlStatement );
  +            if ( log.isDebugEnabled() ) {
  +                log.debug( "About to execute query: " + sqlStatement );
  +            }
               
               ResultSet rs = ps.executeQuery();
               
  -            log.info( "About to create result set" );
  -            
               result = new ResultImpl(rs, startRow, maxRows);
               context.setVariable(var, result);
  -            
  -            log.info( "Created results and defined variable: " + var );
           }
           catch (SQLException e) {
               throw new JellyException(sqlStatement + ": " + e.getMessage(), e);
  
  
  

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


Mime
View raw message