empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r980782 - in /incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic: config.xml pom.xml src/main/java/org/apache/empire/samples/db/SampleApp.java
Date Fri, 30 Jul 2010 13:22:23 GMT
Author: doebele
Date: Fri Jul 30 13:22:23 2010
New Revision: 980782

URL: http://svn.apache.org/viewvc?rev=980782&view=rev
Log:
EMPIREDB-62

Modified:
    incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/config.xml
    incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/pom.xml
    incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java

Modified: incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/config.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/config.xml?rev=980782&r1=980781&r2=980782&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/config.xml (original)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/config.xml Fri Jul
30 13:22:23 2010
@@ -21,7 +21,7 @@
 
 	<properties>
 		<!-- provider name must match the property-section containing the connection data -->
-		<databaseProvider>hsqldb</databaseProvider>
+		<databaseProvider>sqlserver</databaseProvider>
 	</properties>
 
 	<properties-hsqldb>
@@ -40,7 +40,7 @@
 		<jdbcClass>com.mysql.jdbc.Driver</jdbcClass>
 		<jdbcURL>jdbc:mysql://localhost</jdbcURL>
 		<jdbcUser>root</jdbcUser>
-		<jdbcPwd>empire-db</jdbcPwd>
+		<jdbcPwd>esteam</jdbcPwd>
 		<schemaName>DBSAMPLE</schemaName>
 	</properties-mysql>
 	

Modified: incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/pom.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/pom.xml?rev=980782&r1=980781&r2=980782&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/pom.xml (original)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/pom.xml Fri Jul 30
13:22:23 2010
@@ -54,22 +54,25 @@
 		    <version>10.4.2.0</version>
 		    <!-- <scope>runtime</scope> -->
 		</dependency> 
+		<dependency>
+		    <groupId>mysql</groupId>
+		    <artifactId>mysql-connector-java</artifactId>
+		    <version>5.1.6</version>
+		</dependency>
 
-		<!-- ojdbc 
+		<!-- ojdbc --> 
 		<dependency>
 		    <groupId>ojdbc</groupId>
 		    <artifactId>ojdbc</artifactId>
 		    <version>14</version>
 		</dependency>
-		-->
-
-		<!-- msssql 
+		
+		<!-- msssql --> 
 		<dependency>
 		    <groupId>microsoft</groupId>
 		    <artifactId>sqljdbc</artifactId>
 		    <version>1.0</version>
 		</dependency>
-		-->
 		
 	</dependencies>
 	<build>

Modified: incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java?rev=980782&r1=980781&r2=980782&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java
(original)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleApp.java
Fri Jul 30 13:22:23 2010
@@ -27,6 +27,7 @@ import org.apache.empire.commons.ErrorOb
 import org.apache.empire.db.DBColumnExpr;
 import org.apache.empire.db.DBCommand;
 import org.apache.empire.db.DBDatabaseDriver;
+import org.apache.empire.db.DBDriverFeature;
 import org.apache.empire.db.DBReader;
 import org.apache.empire.db.DBRecord;
 import org.apache.empire.db.DBSQLScript;
@@ -169,13 +170,13 @@ public class SampleApp 
 		logger.info("Connecting to Database'" + config.getJdbcURL() + "' / User=" + config.getJdbcUser());
 		try
         {
-            // Connect to the databse
+            // Connect to the database
 			Class.forName(config.getJdbcClass()).newInstance();
 			conn = DriverManager.getConnection(config.getJdbcURL(), config.getJdbcUser(), config.getJdbcPwd());
 			logger.info("Connected successfully");
-			// set the AutoCommit to false this session. You must commit
-			// explicitly now
-			conn.setAutoCommit(true);
+			// set the AutoCommit to false for this connection. 
+			// commit must be called explicitly! 
+			conn.setAutoCommit(false);
 			logger.info("AutoCommit is " + conn.getAutoCommit());
 
 		} catch (Exception e)
@@ -418,6 +419,10 @@ public class SampleApp 
         // Set constraints and order
         cmd.where(EMP.LASTNAME.length().isGreaterThan(0));
         cmd.orderBy(EMP.LASTNAME, EMP.FIRSTNAME);
+
+        cmd.limitRows(20);
+        if (db.getDriver().isSupported(DBDriverFeature.QUERY_SKIP_ROWS))
+            cmd.skipRows(1);
         
 		// Query Records and print output
 		DBReader reader = new DBReader();



Mime
View raw message