[Tynstep-svn] r127 - in trunk: step-dataloader/src/main/java/com/tyndalehouse/step/dataloader step-web-app
ChrisBurrell at crosswire.org
ChrisBurrell at crosswire.org
Tue Apr 20 13:05:11 MST 2010
Author: ChrisBurrell
Date: 2010-04-20 13:05:11 -0700 (Tue, 20 Apr 2010)
New Revision: 127
Modified:
trunk/step-dataloader/src/main/java/com/tyndalehouse/step/dataloader/ClientDbProvider.java
trunk/step-dataloader/src/main/java/com/tyndalehouse/step/dataloader/Dataloader.java
trunk/step-web-app/pom.xml
Log:
changed to enable database build to work
Modified: trunk/step-dataloader/src/main/java/com/tyndalehouse/step/dataloader/ClientDbProvider.java
===================================================================
--- trunk/step-dataloader/src/main/java/com/tyndalehouse/step/dataloader/ClientDbProvider.java 2010-04-18 22:45:53 UTC (rev 126)
+++ trunk/step-dataloader/src/main/java/com/tyndalehouse/step/dataloader/ClientDbProvider.java 2010-04-20 20:05:11 UTC (rev 127)
@@ -3,13 +3,14 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
+import java.sql.Statement;
public class ClientDbProvider {
//TODO: shove this in a properties file
private static String clientConnection = "jdbc:derby:";
private static Connection connection = null;
- public static Connection getConnection(String dbPath) throws SQLException {
+ public synchronized static Connection getConnection(String dbPath) throws SQLException {
if(connection == null) {
String connectionString = clientConnection + dbPath + ";create=true";
System.out.println("Using connection string: " + connectionString);
@@ -28,4 +29,14 @@
public static Connection getConnection() {
return connection;
}
+
+ public static void tearDown() {
+ try {
+ finaliseConnection(getConnection());
+ DriverManager.getConnection("jdbc:derby:;shutdown=true");
+ } catch (SQLException e) {
+ //shutdown exception
+ }
+
+ }
}
Modified: trunk/step-dataloader/src/main/java/com/tyndalehouse/step/dataloader/Dataloader.java
===================================================================
--- trunk/step-dataloader/src/main/java/com/tyndalehouse/step/dataloader/Dataloader.java 2010-04-18 22:45:53 UTC (rev 126)
+++ trunk/step-dataloader/src/main/java/com/tyndalehouse/step/dataloader/Dataloader.java 2010-04-20 20:05:11 UTC (rev 127)
@@ -1,13 +1,11 @@
package com.tyndalehouse.step.dataloader;
-import org.apache.commons.logging.Log;
-import org.apache.log4j.Logger;
-
import java.io.IOException;
import java.sql.SQLException;
import java.util.Calendar;
import org.apache.commons.dbutils.DbUtils;
+import org.apache.log4j.Logger;
import org.crosswire.jsword.book.install.InstallException;
import org.crosswire.jsword.passage.NoSuchKeyException;
@@ -19,6 +17,11 @@
public class Dataloader {
private static Logger log = Logger.getLogger(Dataloader.class);
+ private static void cleanup() {
+ ClientDbProvider.tearDown();
+
+ }
+
public static void main(String args[]) throws SQLException, ClassNotFoundException, IOException, DateParsingException, NoSuchKeyException, InstallException {
try {
if(System.getProperty("driver") != null) {
@@ -32,24 +35,21 @@
JSwordModuleInstaller jmi = new JSwordModuleInstaller();
jmi.installDefaultModules();
-// long startTime= Calendar.getInstance().getTimeInMillis();
-//
-// sl.recreateAll();
-// long currentTime = Calendar.getInstance().getTimeInMillis();
-// System.out.println("Took " + (currentTime-startTime ) + "ms to create schema");
-// startTime = currentTime;
-// tl.loadData();
-//
-// currentTime = Calendar.getInstance().getTimeInMillis();
-// System.out.println("Took " + (currentTime-startTime ) + "ms to load data");
-//
-// startTime = currentTime;
-// currentTime = Calendar.getInstance().getTimeInMillis();
-// System.out.println("Took " + (currentTime-startTime ) + "ms to install bibles");
-//
+ long startTime= Calendar.getInstance().getTimeInMillis();
+
+ sl.recreateAll();
+ long currentTime = Calendar.getInstance().getTimeInMillis();
+ System.out.println("Took " + (currentTime-startTime ) + "ms to create schema");
+ startTime = currentTime;
+ tl.loadData();
+
+ currentTime = Calendar.getInstance().getTimeInMillis();
+ System.out.println("Took " + (currentTime-startTime ) + "ms to load data");
+
+ cleanup();
+
} catch(Exception ex) {
log.error(ex);
}
}
-
}
Modified: trunk/step-web-app/pom.xml
===================================================================
--- trunk/step-web-app/pom.xml 2010-04-18 22:45:53 UTC (rev 126)
+++ trunk/step-web-app/pom.xml 2010-04-20 20:05:11 UTC (rev 127)
@@ -188,6 +188,7 @@
<directory>war</directory>
<excludes>
<exclude>WEB-INF/web.xml</exclude>
+ <exclude>.svn</exclude>
</excludes>
</fileset>
</filesets>
@@ -201,15 +202,15 @@
<systemPropertyVariables>
<db.driver>${db.driver}</db.driver>
<connection.string>${db.connection.string}</connection.string>
- <step.proxy.host>10.154.1.44</step.proxy.host>
- <step.proxy.port>8080</step.proxy.port>
+ <step.proxy.host>${step.http.proxy}</step.proxy.host>
+ <step.proxy.port>{step.http.port}</step.proxy.port>
</systemPropertyVariables>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
-<plugin>
+ <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.3</version>
More information about the Tynstep-svn
mailing list