db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1177589 - in /db/derby/code/trunk/java/demo/toursdb: build.xml insertMaps.java
Date Fri, 30 Sep 2011 10:56:16 GMT
Author: kahatlen
Date: Fri Sep 30 10:56:15 2011
New Revision: 1177589

URL: http://svn.apache.org/viewvc?rev=1177589&view=rev
Log:
DERBY-5438: Empty MAPS table in toursdb

- Let insertMaps.main() throw exceptions instead of just printing them
  to make errors stop the build

- Change URL in insertMaps to match the URL in build.xml

- Change directory for the process running insertMaps so that it finds
  the gif files

Modified:
    db/derby/code/trunk/java/demo/toursdb/build.xml
    db/derby/code/trunk/java/demo/toursdb/insertMaps.java

Modified: db/derby/code/trunk/java/demo/toursdb/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/toursdb/build.xml?rev=1177589&r1=1177588&r2=1177589&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/toursdb/build.xml (original)
+++ db/derby/code/trunk/java/demo/toursdb/build.xml Fri Sep 30 10:56:15 2011
@@ -89,11 +89,12 @@
     <java classname="toursdb.insertMaps"
           output="${generated.toursdb.dir}/toursdb.out" append="true"
           failonerror="true"
-          dir="${generated.toursdb.dir}" fork="true">
+          dir="${derby.demo.src.dir}/toursdb" fork="true">
       <classpath>
         <pathelement path="${out.dir}"/>
         <pathelement path="${compile.classpath}"/>
       </classpath>
+      <sysproperty key="derby.system.home" value="${generated.toursdb.dir}"/>
     </java>
     <java classname="org.apache.derby.tools.ij"
           output="${generated.toursdb.dir}/toursdb.out" append="true"

Modified: db/derby/code/trunk/java/demo/toursdb/insertMaps.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/toursdb/insertMaps.java?rev=1177589&r1=1177588&r2=1177589&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/toursdb/insertMaps.java (original)
+++ db/derby/code/trunk/java/demo/toursdb/insertMaps.java Fri Sep 30 10:56:15 2011
@@ -37,32 +37,21 @@ import java.sql.SQLException;
 public class insertMaps {
 
 	public static final String CSdriver = new String("org.apache.derby.jdbc.EmbeddedDriver");
-	public static final String dbURLCS = new String("jdbc:derby:toursDB");
+	public static final String dbURLCS = new String("jdbc:derby:toursdb");
 
 	public static void main(String[] args) throws Exception {
 
-		try {
-			Connection connCS = null;
-
-			System.out.println("Loading the Derby jdbc driver...");
-			Class.forName(CSdriver).newInstance();
+		System.out.println("Loading the Derby jdbc driver...");
+		Class.forName(CSdriver).newInstance();
 	
-			System.out.println("Getting Derby database connection...");
-			connCS = DriverManager.getConnection(dbURLCS);
-			System.out.println("Successfully got the Derby database connection...");
-
-			System.out.println("Inserted " + insertRows(null,connCS) + " rows into the ToursDB");
-
-			connCS.close();
-
-		} catch (SQLException e) {
-			System.out.println ("FAIL -- unexpected exception: " + e.toString());
-			e.printStackTrace();
-		} catch (Exception e) {
-			System.out.println ("FAIL -- unexpected exception: " + e.toString());
-			e.printStackTrace();
-		}
+		System.out.println("Getting Derby database connection...");
+		Connection connCS = DriverManager.getConnection(dbURLCS);
+		System.out.println("Successfully got the Derby database connection...");
+
+		System.out.println("Inserted " + insertRows(null, connCS) +
+						   " rows into the ToursDB");
 
+		connCS.close();
 	}
 	
 	public static int insertRows(String path, Connection conn) 



Mime
View raw message