[jboss-svn-commits] JBL Code SVN: r15011 - in labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action: lib and 3 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Sep 11 08:41:48 EDT 2007


Author: tcunning
Date: 2007-09-11 08:41:48 -0400 (Tue, 11 Sep 2007)
New Revision: 15011

Added:
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/hsqldb/
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/hsqldb/create.sql
Removed:
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/create.sql
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/lib/mysql-connector-java-3.1.12-bin.jar
Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/populate.sql
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldsqlaction/MyAction.java
Log:
bug:JBESB-996
Convert helloworld_sql_quickstart to use hsqldb, remove mysql jar.


Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/build.xml	2007-09-11 11:28:46 UTC (rev 15010)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/build.xml	2007-09-11 12:41:48 UTC (rev 15011)
@@ -5,67 +5,61 @@
 		${line.separator}
 	</description>
 	
-	<property name="additional.deploys" value="lib/*.jar" />
+	<property name="additional.deploys" value="jbossesb-service.xml" />
 	
-	
 	<!-- Import the base Ant build script... -->
 	<import file="../conf/base-build.xml"/>
-  
-  <target name="runtest" description="Insert row data into sql table polled by gateway">
-     <echo>Insert row data into sql table polled by gateway</echo>
 
-      <input message="Please enter the root password for your running MySQL Server.  Press return if password is blank." defaultvalue="" addproperty="root-pw" />
-      <exec executable="mysql" input="populate.sql" >
-  		<arg value="--user=root" />
-  		<arg value="--password=${root-pw}" />
-  		<arg value="--database=test_sql_gateway" />
-  	</exec>
-  </target>  
+	<target name="quickstart-specific-assemblies" description="Quickstart specific assemblies">
+	</target>
 
-	  <target name="dropdb" description="drop database">
-	    <echo>Drop database</echo>
-        <input message="Please enter the root password for your running MySQL Server.  Press return if password is blank." defaultvalue="" addproperty="root-pw" />
-	  	<exec executable="mysql" >
-	  		<arg value="--user=root" />
-	  		<arg value="--password=${root-pw}" />
-	  		<arg value="--execute=drop database test_sql_gateway" />
-	  	</exec>
-	  </target>  
+	<target name="quickstart-specific-deploys" description="Quickstart specific deploys">
+		<copy file="quickstart-ds.xml" 
+			todir="${org.jboss.esb.server.deploy.dir}"
+			overwrite="false"/>
+	</target>
+  
+	<target name="runtest" depends="dependencies" description="Insert row data into sql table polled by gateway">
+                <property name="hsqldb.jar"
+                        value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>	
+				<echo>Insert row data into sql table polled by gateway</echo>
+                <sql
+                        driver="org.hsqldb.jdbcDriver"
+						url="jdbc:hsqldb:hsql://localhost:1703"
+                        userid="sa"	
+						autocommit="true"
+						password="">
+                        <classpath>
+				<pathelement path="${hsqldb.jar}"/>
+                        </classpath>
+			<transaction src="populate.sql"/>
+			</sql>
+	</target>  
 
-	<target name="createdb" description="createdb">
-	    <echo>Create database and test table</echo>
-        <input message="Please enter the root password for your running MySQL Server.  Press return if password is blank." defaultvalue="" addproperty="root-pw" />
-	  	<exec executable="mysql" input="create.sql" >
-	  		<arg value="--user=root" />
-	  		<arg value="--password=${root-pw}" />
-	  	</exec>
-	  </target>  
+	<target name="select" depends="dependencies" description="select * from gateway_table">
+		<property name="hsqldb.jar" 
+			value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+		<echo>Select * from gateway_table</echo>
+		<sql	
+			print="true"
+			driver="org.hsqldb.jdbcDriver"
+			url="jdbc:hsqldb:hsql://localhost:1703"
+			userid="sa"
+			autocommit="true"
+			password="">
+			<classpath>
+				<pathelement path="${hsqldb.jar}"/>
+			</classpath>
+			<transaction>
+			select * from gateway_table
+			</transaction>
+			</sql>
+	</target>  
 
-	  <target name="purgetable" description="purgetable">
-	     <echo>Purge sql table polled by gateway</echo>
-          <input message="Please enter the root password for your running MySQL Server.  Press return if password is blank." defaultvalue="" addproperty="root-pw" />
-	  	<exec executable="mysql" >
-	  		<arg value="--user=root" />
-	  		<arg value="--password=${root-pw}" />
-	  		<arg value="--database=test_sql_gateway" />
-	  		<arg value="--execute=delete from gateway_table" />
-	  	</exec>
-	  </target>  
-
-	  <target name="select" description="select * from gateway_table">
-	     <echo>Select * from gateway_table</echo>
-          <input message="Please enter the root password for your running MySQL Server.  Press return if password is blank." defaultvalue="" addproperty="root-pw" />
-	  	<exec executable="mysql" >
-	  		<arg value="--user=root" />
-	  		<arg value="--password=${root-pw}" />
-	  		<arg value="--database=test_sql_gateway" />
-	  		<arg value="--execute=select * from gateway_table" />
-	  	</exec>
-	  </target>  
-
-    <target name="deploy-jms-dests">
-        <echo message="This quickstart doesn't use any JMS Destinations.  No JMS deployments required." />
+	<target name="deploy-jms-dests">
+		<echo message="This quickstart doesn't use any JMS Destinations.  No JMS deployments required." />
     </target>
+	
     <target name="undeploy-jms-dests">
         <echo message="This quickstart doesn't use any JMS Destinations.  No JMS undeployments required." />
     </target>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/create.sql
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/create.sql	2007-09-11 11:28:46 UTC (rev 15010)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/create.sql	2007-09-11 12:41:48 UTC (rev 15011)
@@ -1,10 +0,0 @@
--- drop database test_sql_gateway;
-create database test_sql_gateway;
-use test_sql_gateway;
-create table gateway_table
-(
-unique_id serial
-,data_column text
-,status_col text
-);
-create unique index  uid_index  on gateway_table (unique_id);

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml	2007-09-11 11:28:46 UTC (rev 15010)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml	2007-09-11 12:41:48 UTC (rev 15011)
@@ -3,16 +3,15 @@
 
     <providers>
           <sql-provider name="SQLprovider" 
-          			url="jdbc:mysql://localhost:3306/test_sql_gateway"
-          			driver="com.mysql.jdbc.Driver"
-          			username="root"
-          			password="root"
-          >
+          			url="jdbc:hsqldb:hsql://localhost:1703"
+          			driver="org.hsqldb.jdbcDriver"
+          			username="sa"
+          			password="">
           	<sql-bus busid="helloSQLChannel" >
           		<sql-message-filter
-          			tablename="gateway_table"
-          			status-column="status_col"
-          			message-id-column="unique_id"
+          			tablename="GATEWAY_TABLE"
+          			status-column="STATUS_COL"
+          			message-id-column="UNIQUE_ID"
           		/>
           	</sql-bus>
           </sql-provider>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/lib/mysql-connector-java-3.1.12-bin.jar
===================================================================
(Binary files differ)

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/populate.sql
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/populate.sql	2007-09-11 11:28:46 UTC (rev 15010)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/populate.sql	2007-09-11 12:41:48 UTC (rev 15011)
@@ -1,6 +1,5 @@
-use test_sql_gateway;
-insert into gateway_table values(0,'data 111111','p');
-insert into gateway_table values(0,'data 22','p');
-insert into gateway_table values(0,'data 333333333333111111','p');
-insert into gateway_table values(0,'data d d d d','p');
-insert into gateway_table values(0,'data last record','p');
+insert into gateway_table(data_column, status_col) values('data 111111','P');
+insert into gateway_table(data_column, status_col) values('data 22','P');
+insert into gateway_table(data_column, status_col) values('data 333333333333111111','P');
+insert into gateway_table(data_column, status_col) values('data d d d d','P');
+insert into gateway_table(data_column, status_col) values('data last record','P');

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/readme.txt	2007-09-11 11:28:46 UTC (rev 15010)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/readme.txt	2007-09-11 12:41:48 UTC (rev 15011)
@@ -8,11 +8,9 @@
   and a more detailed descripton of the different ways to run the quickstarts.
 
   NOTE:
-  1. MySQL must be installed and running.  You'll need to know the root password and
-     this password must also be set on the <sql-provider> in the jboss-esb.xml file.
-  2. The "mysql" shell/script interpreter must be installed on the system path.
-  3. The MySQL drivers must be installed in your JBoss Application Server in the
-     server/default/lib dir (server/<server>/lib).
+  1. This quickstart uses hsqldb so that it can be deployed without any 
+	setup required.   
+  2. "ant select" will show you the contents of the database table
 
 To Run standalone mode:
 =======================

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/hsqldb/create.sql
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/hsqldb/create.sql	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/hsqldb/create.sql	2007-09-11 12:41:48 UTC (rev 15011)
@@ -0,0 +1,6 @@
+create table gateway_table
+(
+unique_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+data_column VARCHAR(255) NOT NULL,
+status_col VARCHAR(255) NOT NULL
+);

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldsqlaction/MyAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldsqlaction/MyAction.java	2007-09-11 11:28:46 UTC (rev 15010)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldsqlaction/MyAction.java	2007-09-11 12:41:48 UTC (rev 15011)
@@ -45,6 +45,7 @@
 		 for (Map.Entry<String,Object> curr : rowData.entrySet()) {
 			  results.append("column "+curr.getKey()+" = <" + curr.getValue()+">");
 		  }
+		 System.out.println(results.toString());
 		  logFooter();
 		  
 		  // Set message properties and message body so that SystemPrintln will display message 




More information about the jboss-svn-commits mailing list