tbrugz avatar tbrugz committed d419f86

build: added start/load/stop db ; classpath fixes

Comments (0)

Files changed (5)

build.template.properties

 deploy.dir=/opt/apache-tomcat-7.0.22/webapps
 jdbc.jar=h2-1.3.168.jar
-servlet.jar=geronimo-servlet_3.0_spec-1.0.jar
+servlet.jar=geronimo-servlet_3.0_spec-1.0.jar
+h2.jar=h2-1.3.168.jar
+h2.basedir=/home/xxx
 	</fileset>
 	
 	<path id="classpath.compile">
-		<path refid="fileset.base" />
-		<path refid="fileset.compile" />
+		<fileset refid="fileset.base" />
+		<fileset refid="fileset.compile" />
+	</path>
+
+	<path id="classpath.sqldump">
+		<fileset refid="fileset.base" />
+		<fileset refid="fileset.compile" />
+		<fileset refid="fileset.war" />
 	</path>
 	
 	<target name="prepare">
 			</fileset>
 		</copy>
 	</target>
+
+	<target name="start-db" description="init H2 database">
+		<java classpath="${lib.dir}/${h2.jar}" classname="org.h2.tools.Server" fork="true">
+			<arg value="-tcp"/>
+			<arg value="-web"/>
+			<arg value="-baseDir"/>
+			<arg value="${h2.basedir}"/>
+			<!--arg value="-trace"/-->
+		</java>
+	</target>
+	
+	<target name="load-r2rml-db">
+		<java classpathref="classpath.sqldump" classname="tbrugz.sqldump.sqlrun.SQLRun" fork="true">
+			<jvmarg value="-Dsqlrun.dburl=jdbc:h2:tcp://localhost/r2rml"/>
+			<arg value="-propfile=src_test/tbrugz/queryon/r2rml/sqlrun.properties"/>
+		</java>
+	</target>
+	
+	<target name="stop-db" description="stop H2 database">
+		<java classpath="${lib.dir}/${h2.jar}" classname="org.h2.tools.Server" fork="true">
+			<arg value="-tcpShutdown"/>
+			<arg value="tcp://localhost:9092"/>
+			<arg value="-tcpShutdownForce"/>
+		</java>
+	</target>
 	
 	<target name="resolve-ivy" description="retrieve dependencies with ivy">
 		<ivy:retrieve haltonfailure="false"/>

src/queryon.template.properties

 #queryon.datasource=jdbc/LocalTestDB
 
 # example usage
-queryon.dburl=jdbc:h2:~/r2rml.db;DB_CLOSE_DELAY=-1
+#queryon.dburl=jdbc:h2:~/r2rml.db;DB_CLOSE_DELAY=-1
+queryon.dburl=jdbc:h2:tcp://localhost/r2rml
 queryon.user=h
 queryon.password=h

src_test/tbrugz/queryon/r2rml/sqldump.properties

 sqldump.xmlserialization.jaxb.outfile=${outputdir}/r2rml-model.jaxb.xml
 
 sqldump.driverclass=org.h2.Driver
-#sqldump.dburl=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
+sqldump.dburl=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
 #sqldump.dburl=jdbc:h2:tcp://localhost/r2rml
-sqldump.dburl=jdbc:h2:~/r2rml.db;DB_CLOSE_DELAY=-1
+#sqldump.dburl=jdbc:h2:~/r2rml.db;DB_CLOSE_DELAY=-1
 sqldump.user=h
 sqldump.password=h

src_test/tbrugz/queryon/r2rml/sqlrun.properties

 sqlrun.exec.11.file=src_test/tbrugz/queryon/r2rml/data.sql
 
 sqlrun.driverclass=org.h2.Driver
-#sqlrun.dburl=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
+sqlrun.dburl=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
 #sqlrun.dburl=jdbc:h2:tcp://localhost/r2rml
-sqlrun.dburl=jdbc:h2:~/r2rml.db;DB_CLOSE_DELAY=-1
+#sqlrun.dburl=jdbc:h2:~/r2rml.db;DB_CLOSE_DELAY=-1
 sqlrun.user=h
 sqlrun.password=h
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.