Pārlūkot izejas kodu

Simplified boot application

Ben Hale 11 gadi atpakaļ
vecāks
revīzija
f1ffc4325c

+ 46 - 31
spring/pom.xml

@@ -1,59 +1,65 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
     <modelVersion>4.0.0</modelVersion>
-    <groupId>com.techempower</groupId>
-    <artifactId>spring</artifactId>
-    <name>Spring MVC sample project</name>
-    <packaging>war</packaging>
-    <version>1.0.0-SNAPSHOT</version>
+
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>0.5.0.M5</version>
+        <version>0.5.0.BUILD-SNAPSHOT</version>
     </parent>
+
+    <groupId>com.techempower</groupId>
+    <artifactId>spring</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>war</packaging>
+    <name>Spring MVC sample project</name>
+
     <properties>
+        <mysql.version>5.1.23</mysql.version>
+
+        <jackson.version>2.1.1</jackson.version>
         <java.version>1.7</java.version>
         <spring.version>4.0.0.RC1</spring.version>
-        <springboot.version>0.5.0.M5</springboot.version>
+        <spring-data-jpa.version>1.4.2.RELEASE</spring-data-jpa.version>
+        <tomcat.version>8.0.0-RC5</tomcat.version>
     </properties>
+
     <dependencies>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-            <version>${springboot.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-jpa</artifactId>
-            <version>${springboot.version}</version>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
-            <groupId>org.thymeleaf</groupId>
-            <artifactId>thymeleaf-spring3</artifactId>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql.version}</version>
         </dependency>
-        <!-- Override Jackson version to match other benchmarks -->
         <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-            <version>2.1.1</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
         </dependency>
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>5.1.23</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-            <version>1.3.172</version>
+            <groupId>org.thymeleaf</groupId>
+            <artifactId>thymeleaf-spring3</artifactId>
+            <version>${thymeleaf.version}</version>
         </dependency>
         <dependency>
             <groupId>org.yaml</groupId>
             <artifactId>snakeyaml</artifactId>
         </dependency>
     </dependencies>
+
     <build>
+        <finalName>spring</finalName>
+
         <plugins>
             <plugin>
                 <groupId>org.springframework.boot</groupId>
@@ -61,10 +67,19 @@
             </plugin>
         </plugins>
     </build>
+
     <repositories>
         <repository>
-            <id>spring-snapshots</id>
-            <url>http://repo.spring.io/libs-snapshot</url>
+            <id>spring-milestones</id>
+            <url>http://repo.spring.io/milestone</url>
         </repository>
     </repositories>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>spring-milestones</id>
+            <url>http://repo.spring.io/milestone</url>
+        </pluginRepository>
+    </pluginRepositories>
+
 </project>

+ 4 - 4
spring/setup.py

@@ -5,18 +5,18 @@ import os
 
 def start(args):
   setup_util.replace_text("spring/src/main/webapp/WEB-INF/resin-web.xml", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306")
-  
+
   try:
-    subprocess.check_call("mvn clean compile war:war", shell=True, cwd="spring")
+    subprocess.check_call("mvn clean package", shell=True, cwd="spring")
 
     if os.name == 'nt':
       subprocess.check_call('rmdir /S /Q "%RESIN_HOME%\\webapps\\"', shell=True)
       subprocess.check_call('mkdir "%RESIN_HOME%\\webapps\\"', shell=True)
-      subprocess.check_call('copy spring\\target\\spring-1.0.0-SNAPSHOT.war "%RESIN_HOME%\\webapps\\spring.war"', shell=True)
+      subprocess.check_call('copy spring\\target\\spring.war "%RESIN_HOME%\\webapps\\spring.war"', shell=True)
       subprocess.check_call('"%RESIN_HOME%\\bin\\start.bat"', shell=True)
     else:
       subprocess.check_call("rm -rf $RESIN_HOME/webapps/*", shell=True)
-      subprocess.check_call("cp spring/target/spring-1.0.0-SNAPSHOT.war $RESIN_HOME/webapps/spring.war", shell=True)
+      subprocess.check_call("cp spring/target/spring.war $RESIN_HOME/webapps/spring.war", shell=True)
       subprocess.check_call("$RESIN_HOME/bin/resinctl start", shell=True)
     return 0
   except subprocess.CalledProcessError:

+ 14 - 33
spring/src/main/java/com/techempower/spring/SampleApplication.java

@@ -4,46 +4,27 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.orm.jpa.JpaTransactionManager;
-import org.springframework.orm.jpa.JpaVendorAdapter;
-import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
-import org.springframework.orm.jpa.vendor.Database;
-import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
-import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.context.annotation.Profile;
+import org.springframework.jndi.JndiObjectFactoryBean;
 
 import javax.sql.DataSource;
 
-@Configuration
-@EnableAutoConfiguration
 @ComponentScan
+@EnableAutoConfiguration
 public class SampleApplication {
 
-	public static void main(String[] args) throws Exception {
-		new SpringApplicationBuilder(SampleApplication.class).run(args);
-	}
-
-	@Bean
-	public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource, JpaVendorAdapter jpaVendorAdapter) {
-		LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
-		lef.setDataSource(dataSource);
-		lef.setJpaVendorAdapter(jpaVendorAdapter);
-		lef.setPackagesToScan("com.techempower.spring");
-		return lef;
-	}
+    public static void main(String[] args) throws Exception {
+        new SpringApplicationBuilder(SampleApplication.class).run(args);
+    }
 
-	@Bean
-	public JpaVendorAdapter jpaVendorAdapter() {
-		HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
-		hibernateJpaVendorAdapter.setShowSql(false);
-		hibernateJpaVendorAdapter.setGenerateDdl(true);
-		hibernateJpaVendorAdapter.setDatabase(Database.MYSQL);
-		return hibernateJpaVendorAdapter;
-	}
+    @Profile("default")
+    @Bean
+    JndiObjectFactoryBean defaultDataSource() {
+        JndiObjectFactoryBean factoryBean = new JndiObjectFactoryBean();
+        factoryBean.setJndiName("java:jdbc/hello_world");
+        factoryBean.setExpectedType(DataSource.class);
 
-	@Bean
-	public PlatformTransactionManager transactionManager() {
-		return new JpaTransactionManager();
-	}
+        return factoryBean;
+    }
 
 }

+ 22 - 0
spring/src/main/java/com/techempower/spring/SampleApplicationInitializer.java

@@ -0,0 +1,22 @@
+package com.techempower.spring;
+
+import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
+
+public final class SampleApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
+
+    @Override
+    protected Class<?>[] getRootConfigClasses() {
+        return new Class[0];
+    }
+
+    @Override
+    protected Class<?>[] getServletConfigClasses() {
+        return new Class[]{SampleApplication.class};
+    }
+
+    @Override
+    protected String[] getServletMappings() {
+        return new String[]{"/"};
+    }
+
+}

+ 0 - 21
spring/src/main/java/com/techempower/spring/config/BenchConfiguration.java

@@ -1,21 +0,0 @@
-package com.techempower.spring.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.sql.DataSource;
-
-@Configuration
-@Profile("bench")
-public class BenchConfiguration {
-
-	@Bean
-	public DataSource dataSource() throws Exception {
-		// Using JNDI lookup for pre-installed MySQL on bench env
-		Context ctx = new InitialContext();
-		return (DataSource) ctx.lookup("java:jdbc/hello_world");
-	}
-}

+ 0 - 21
spring/src/main/java/com/techempower/spring/config/LocalConfiguration.java

@@ -1,21 +0,0 @@
-package com.techempower.spring.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
-
-import javax.sql.DataSource;
-
-import static org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType.H2;
-
-@Configuration
-@Profile("local")
-public class LocalConfiguration {
-
-	@Bean
-	public DataSource dataSource() {
-		// Using embedded H2 database for local tests
-		return new EmbeddedDatabaseBuilder().setType(H2).build();
-	}
-}

+ 31 - 31
spring/src/main/java/com/techempower/spring/domain/Fortune.java

@@ -5,35 +5,35 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 
 @Entity
-public class Fortune
-		implements Comparable<Fortune> {
-	@Id
-	@GeneratedValue
-	public int id;
-	public String message;
-
-	public Fortune() {
-
-	}
-
-	public Fortune(int id, String message) {
-		this.id = id;
-		this.message = message;
-	}
-
-	public int getId() {
-		return this.id;
-	}
-
-	public String getMessage() {
-		return this.message;
-	}
-
-	/**
-	 * For our purposes, Fortunes sort by their message text.
-	 */
-	@Override
-	public int compareTo(Fortune other) {
-		return message.compareTo(other.message);
-	}
+public final class Fortune implements Comparable<Fortune> {
+
+    @Id
+    @GeneratedValue
+    private volatile Integer id;
+
+    public volatile String message;
+
+    Fortune() {
+    }
+
+    public Fortune(Integer id, String message) {
+        this.id = id;
+        this.message = message;
+    }
+
+    public Integer getId() {
+        return this.id;
+    }
+
+    public String getMessage() {
+        return this.message;
+    }
+
+    /**
+     * For our purposes, Fortunes sort by their message text.
+     */
+    @Override
+    public int compareTo(Fortune other) {
+        return message.compareTo(other.message);
+    }
 }

+ 23 - 5
spring/src/main/java/com/techempower/spring/domain/World.java

@@ -5,9 +5,27 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 
 @Entity
-public class World {
-	@Id
-	@GeneratedValue
-	public int id;
-	public int randomNumber;
+public final class World {
+
+    @Id
+    @GeneratedValue
+    private volatile Integer id;
+
+    private volatile Integer randomNumber;
+
+    World() {
+    }
+
+    public World(Integer id, Integer randomNumber) {
+        this.id = id;
+        this.randomNumber = randomNumber;
+    }
+
+    public Integer getRandomNumber() {
+        return randomNumber;
+    }
+
+    public void setRandomNumber(Integer randomNumber) {
+        this.randomNumber = randomNumber;
+    }
 }

+ 8 - 0
spring/src/main/java/com/techempower/spring/repository/FortuneRepository.java

@@ -0,0 +1,8 @@
+package com.techempower.spring.repository;
+
+import com.techempower.spring.domain.Fortune;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface FortuneRepository extends JpaRepository<Fortune, Integer> {
+
+}

+ 8 - 0
spring/src/main/java/com/techempower/spring/repository/WorldRepository.java

@@ -0,0 +1,8 @@
+package com.techempower.spring.repository;
+
+import com.techempower.spring.domain.World;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface WorldRepository extends JpaRepository<World, Integer> {
+
+}

+ 0 - 13
spring/src/main/java/com/techempower/spring/service/FortuneRepository.java

@@ -1,13 +0,0 @@
-package com.techempower.spring.service;
-
-import com.techempower.spring.domain.Fortune;
-import org.springframework.data.repository.CrudRepository;
-
-import java.util.List;
-
-public interface FortuneRepository extends CrudRepository<Fortune, Integer> {
-
-	@Override
-	public List<Fortune> findAll();
-
-}

+ 0 - 7
spring/src/main/java/com/techempower/spring/service/WorldRepository.java

@@ -1,7 +0,0 @@
-package com.techempower.spring.service;
-
-import com.techempower.spring.domain.World;
-import org.springframework.data.repository.CrudRepository;
-
-public interface WorldRepository extends CrudRepository<World, Integer> {
-}

+ 13 - 13
spring/src/main/java/com/techempower/spring/web/FortuneController.java

@@ -1,28 +1,28 @@
 package com.techempower.spring.web;
 
 import com.techempower.spring.domain.Fortune;
-import com.techempower.spring.service.FortuneRepository;
+import com.techempower.spring.repository.FortuneRepository;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.servlet.ModelAndView;
 
 import java.util.Collections;
 import java.util.List;
 
 @Controller
-public class FortuneController {
+final class FortuneController {
 
-	@Autowired
-	private FortuneRepository fortuneRepository;
+    @Autowired
+    private FortuneRepository fortuneRepository;
 
-	@RequestMapping(value = "/fortunes")
-	public ModelAndView fortunes() {
+    @RequestMapping(value = "/fortunes")
+    String fortunes(ModelMap modelMap) {
+        List<Fortune> fortunes = this.fortuneRepository.findAll();
+        fortunes.add(new Fortune(0, "Additional fortune added at request time."));
+        Collections.sort(fortunes);
 
-		List<Fortune> fortunes = fortuneRepository.findAll();
-		fortunes.add(new Fortune(0, "Additional fortune added at request time."));
-		Collections.sort(fortunes);
-
-		return new ModelAndView("fortunes", "fortunes", fortunes);
-	}
+        modelMap.addAttribute("fortunes", fortunes);
+        return "fortunes";
+    }
 }

+ 20 - 23
spring/src/main/java/com/techempower/spring/web/HelloController.java

@@ -1,36 +1,33 @@
 package com.techempower.spring.web;
 
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
 
-@Controller
-public class HelloController {
+@RestController
+final class HelloController {
 
-	@RequestMapping(value = "/json", produces = "application/json")
-	@ResponseBody
-	public Message json() {
-		return new Message("Hello, world");
-	}
+    @RequestMapping(value = "/json", produces = "application/json")
+    Message json() {
+        return new Message("Hello, world");
+    }
 
-	@RequestMapping(value = "/plaintext", produces = "text/plain")
-	@ResponseBody
-	public String plaintext() {
-		return "Hello, World!";
-	}
+    @RequestMapping(value = "/plaintext", produces = "text/plain")
+    String plaintext() {
+        return "Hello, World!";
+    }
 
-	public static class Message {
+    public static final class Message {
 
-		private final String message;
+        private final String message;
 
-		public Message(String message) {
-			this.message = message;
-		}
+        private Message(String message) {
+            this.message = message;
+        }
 
-		public String getMessage() {
-			return message;
-		}
+        public String getMessage() {
+            return message;
+        }
 
-	}
+    }
 
 }

+ 58 - 59
spring/src/main/java/com/techempower/spring/web/WorldDatabaseController.java

@@ -1,69 +1,68 @@
 package com.techempower.spring.web;
 
 import com.techempower.spring.domain.World;
-import com.techempower.spring.service.WorldRepository;
+import com.techempower.spring.repository.WorldRepository;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Random;
 import java.util.concurrent.ThreadLocalRandom;
 
-@Controller
-public class WorldDatabaseController {
-
-	private static final int DB_ROWS = 10000;
-	@Autowired
-	private WorldRepository worldRepository;
-
-	@RequestMapping(value = "/db", produces = "application/json")
-	@ResponseBody
-	public World singleQuery() {
-		final Random random = ThreadLocalRandom.current();
-		return worldRepository.findOne(random.nextInt(DB_ROWS) + 1);
-	}
-
-	@RequestMapping(value = "/queries", produces = "application/json")
-	@ResponseBody
-	public World[] multipleQueries(Integer queries) {
-		if (queries == null || queries < 1) {
-			queries = 1;
-		}
-		else if (queries > 500) {
-			queries = 500;
-		}
-
-		final World[] worlds = new World[queries];
-		final Random random = ThreadLocalRandom.current();
-
-		for (int i = 0; i < queries; i++) {
-			worlds[i] = worldRepository.findOne(random.nextInt(DB_ROWS) + 1);
-		}
-
-		return worlds;
-	}
-
-	@RequestMapping(value = "/updates", produces = "application/json")
-	@ResponseBody
-	public World[] updateQueries(Integer queries) {
-		if (queries == null || queries < 1) {
-			queries = 1;
-		}
-		else if (queries > 500) {
-			queries = 500;
-		}
-
-		final World[] worlds = multipleQueries(queries);
-		final Random random = ThreadLocalRandom.current();
-
-		for (int i = 0; i < queries; i++) {
-			World world = worlds[i];
-			world.randomNumber = random.nextInt(DB_ROWS) + 1;
-		}
-		worldRepository.save(Arrays.asList(worlds));
-
-		return worlds;
-	}
+@RestController
+final class WorldDatabaseController {
+
+    private static final int DB_ROWS = 10000;
+
+    @Autowired
+    private WorldRepository worldRepository;
+
+    @RequestMapping(value = "/db", produces = "application/json")
+    World singleQuery() {
+        final Random random = ThreadLocalRandom.current();
+        return this.worldRepository.findOne(random.nextInt(DB_ROWS) + 1);
+    }
+
+    @RequestMapping(value = "/queries", produces = "application/json")
+    List<World> multipleQueries(@RequestParam("queries") Integer rawQueryCount) {
+        Integer queryCount = boundQueryCount(rawQueryCount);
+
+        List<World> worlds = new ArrayList<>(queryCount);
+        Random random = ThreadLocalRandom.current();
+
+        for (int i = 0; i < queryCount; i++) {
+            worlds.add(this.worldRepository.findOne(random.nextInt(DB_ROWS) + 1));
+        }
+
+        return worlds;
+    }
+
+    @RequestMapping(value = "/updates", produces = "application/json")
+    List<World> updateQueries(@RequestParam("queries") Integer rawQueryCount) {
+        Integer queryCount = boundQueryCount(rawQueryCount);
+
+        List<World> worlds = multipleQueries(queryCount);
+        Random random = ThreadLocalRandom.current();
+
+        for (World world : worlds) {
+            world.setRandomNumber(random.nextInt(DB_ROWS) + 1);
+        }
+
+        this.worldRepository.save(worlds);
+        return worlds;
+    }
+
+    private Integer boundQueryCount(Integer raw) {
+        if (raw == null || raw < 1) {
+            return 1;
+        } else if (raw > 500) {
+            return 500;
+        }
+
+        return raw;
+    }
+
 }

+ 8 - 8
spring/src/main/resources/application.yml

@@ -1,12 +1,12 @@
+---
 spring:
-  application.name: spring
-  profiles:
-    active: bench
+  datasource:
+    initialize: false
+  jpa:
+    show_sql: false
 
 ---
-
 spring:
-  profiles: bench
-  jpa:
-    open-in-view: false
-    show-sql: false
+  profiles: local
+  datasource:
+    initialize: false

+ 0 - 0
spring/src/main/resources/sample.sql → spring/src/main/resources/import.sql


+ 19 - 3
spring/src/main/resources/logback.xml

@@ -1,5 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
-    <include resource="org/springframework/boot/logging/logback/base.xml"/>
-    <!-- <logger name="com.techempower.spring" level="INFO"/> -->
-</configuration>
+
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%-5level %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <logger name="com.googlecode.flyway" level="INFO"/>
+    <logger name="com.nebhale.buildmonitor" level="${LOGGING_LEVEL:-INFO}"/>
+    <logger name="org.apache" level="ERROR"/>
+    <logger name="org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping" level="INFO"/>
+    <logger name="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping" level="INFO"/>
+    <logger name="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" level="INFO"/>
+
+    <root level="WARN">
+        <appender-ref ref="STDOUT"/>
+    </root>
+
+</configuration>

+ 0 - 13
spring/src/main/webapp/WEB-INF/resin-web.xml

@@ -1,13 +0,0 @@
-<web-app xmlns="http://caucho.com/ns/resin">
-
-<database jndi-name='jdbc/hello_world'>
-  <driver>
-    <type>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</type>
-    <url>jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&amp;elideSetAutoCommits=true&amp;useLocalSessionState=true&amp;cachePrepStmts=true&amp;cacheCallableStmts=true&amp;alwaysSendSetIsolation=false&amp;prepStmtCacheSize=4096&amp;cacheServerConfiguration=true&amp;prepStmtCacheSqlLimit=2048&amp;zeroDateTimeBehavior=convertToNull&amp;traceProtocol=false&amp;useUnbufferedInput=false&amp;useReadAheadInput=false&amp;maintainTimeStats=false&amp;useServerPrepStmts&amp;cacheRSMetadata=true</url>
-    <user>root</user>
-    <password></password>
-    <useUnicode/>
-  </driver>
-</database>
-
-</web-app>