From 9652d439018c7e2dcd5ef3bc490b75d130db6179 Mon Sep 17 00:00:00 2001 From: Calvin Date: Tue, 10 Apr 2012 17:21:23 +0800 Subject: [PATCH] =?UTF-8?q?#34=20H2=E4=BD=BF=E7=94=A8=E6=94=B9=E8=BF=9B?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=86=8D=E5=BC=BA=E5=88=B6=E8=A6=81=E6=B1=82?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E5=90=AF=E5=8A=A8H2=20TCP=20server=EF=BC=8C?= =?UTF-8?q?=E8=80=8C=E6=98=AF=E4=BD=BF=E7=94=A8=E5=B5=8C=E5=85=A5=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E5=8F=AF=E6=8C=81=E4=B9=85=E5=8C=96=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/mini-service/pom.xml | 7 -- .../src/main/resources/application.properties | 6 +- .../mini-web/bin/hibernate/hibernate.cfg.xml | 2 +- examples/mini-web/pom.xml | 9 +- .../src/main/resources/application.properties | 6 +- examples/showcase/pom.xml | 9 +- .../src/main/resources/application.properties | 6 +- quick-start | 9 +- quick-start.bat | 9 +- support/h2/README.txt | 2 +- support/h2/h2-console.bat | 3 + support/h2/h2-server.bat | 2 +- support/h2/pom.xml | 111 +++++++++--------- 13 files changed, 77 insertions(+), 104 deletions(-) create mode 100644 support/h2/h2-console.bat diff --git a/examples/mini-service/pom.xml b/examples/mini-service/pom.xml index d4e79df6..70dbf5ae 100644 --- a/examples/mini-service/pom.xml +++ b/examples/mini-service/pom.xml @@ -364,13 +364,6 @@ - Waiting for the h2 server start... - - - - - - The h2 server started. diff --git a/examples/mini-service/src/main/resources/application.properties b/examples/mini-service/src/main/resources/application.properties index f5968ef3..d028be47 100644 --- a/examples/mini-service/src/main/resources/application.properties +++ b/examples/mini-service/src/main/resources/application.properties @@ -1,12 +1,12 @@ -#h2 standalone database settings +#h2 embedded database settings jdbc.driver=org.h2.Driver -jdbc.url=jdbc:h2:tcp://localhost/~/mini-service4 +jdbc.url=jdbc:h2:file:/~/mini-service4;AUTO_SERVER=TRUE jdbc.username=sa jdbc.password= #log4jdbc driver #jdbc.driver=net.sf.log4jdbc.DriverSpy -#jdbc.url=jdbc:log4jdbc:h2:tcp://localhost/~/mini-service4 +#jdbc.url=jdbc:log4jdbc:h2:file:~/mini-service4;AUTO_SERVER=TRUE #dbcp settings dbcp.maxIdle=20 diff --git a/examples/mini-web/bin/hibernate/hibernate.cfg.xml b/examples/mini-web/bin/hibernate/hibernate.cfg.xml index 58cfadbe..2a105840 100644 --- a/examples/mini-web/bin/hibernate/hibernate.cfg.xml +++ b/examples/mini-web/bin/hibernate/hibernate.cfg.xml @@ -5,7 +5,7 @@ org.h2.Driver - jdbc:h2:tcp://localhost/~/mini-web4 + jdbc:h2:file:~/mini-web4;AUTO_SERVER=TRUE sa org.hibernate.dialect.H2Dialect diff --git a/examples/mini-web/pom.xml b/examples/mini-web/pom.xml index 91fe05a9..9464d95f 100644 --- a/examples/mini-web/pom.xml +++ b/examples/mini-web/pom.xml @@ -379,14 +379,7 @@ - - Waiting for the h2 server start... - - - - - - The h2 server started. + diff --git a/examples/mini-web/src/main/resources/application.properties b/examples/mini-web/src/main/resources/application.properties index b56ffdb1..457de792 100644 --- a/examples/mini-web/src/main/resources/application.properties +++ b/examples/mini-web/src/main/resources/application.properties @@ -1,13 +1,13 @@ -#h2 standalone database settings +#h2 embedded database settings jdbc.driver=org.h2.Driver -jdbc.url=jdbc:h2:tcp://localhost/~/mini-web4 +jdbc.url=jdbc:h2:file:~/mini-web4;AUTO_SERVER=TRUE jdbc.username=sa jdbc.password= hibernate.dialect=org.hibernate.dialect.H2Dialect #log4jdbc driver #jdbc.driver=net.sf.log4jdbc.DriverSpy -#jdbc.url=jdbc:log4jdbc:h2:tcp://localhost/~/mini-web4 +#jdbc.url=jdbc:log4jdbc:h2:file:~/mini-web4;AUTO_SERVER=TRUE #oracle database settings #jdbc.driver=oracle.jdbc.driver.OracleDriver diff --git a/examples/showcase/pom.xml b/examples/showcase/pom.xml index f16d272b..7372f985 100644 --- a/examples/showcase/pom.xml +++ b/examples/showcase/pom.xml @@ -536,14 +536,7 @@ - - Waiting for the h2 server start... - - - - - - The h2 server started. + diff --git a/examples/showcase/src/main/resources/application.properties b/examples/showcase/src/main/resources/application.properties index d0b8a2a7..7c297915 100644 --- a/examples/showcase/src/main/resources/application.properties +++ b/examples/showcase/src/main/resources/application.properties @@ -1,15 +1,15 @@ #h2 standalone database settings jdbc.driver=org.h2.Driver -jdbc.url=jdbc:h2:tcp://localhost/~/showcase4 +jdbc.url=jdbc:h2:file:~/showcase4;AUTO_SERVER=TRUE jdbc.username=sa jdbc.password= hibernate.dialect=org.hibernate.dialect.H2Dialect #log4jdbc driver #jdbc.driver=net.sf.log4jdbc.DriverSpy -#jdbc.url=jdbc:log4jdbc:h2:tcp://localhost/~/showcase4 +#jdbc.url=jdbc:log4jdbc:h2:file:~/showcase4;AUTO_SERVER=TRUE quartz.jdbc.driver=org.h2.Driver -quartz.jdbc.url=jdbc:h2:tcp://localhost/~/showcase-quartz4 +quartz.jdbc.url=jdbc:h2:file:~/showcase-quartz4;AUTO_SERVER=TRUE quartz.jdbc.username=sa quartz.jdbc.password= diff --git a/quick-start b/quick-start index ea81923d..54622f09 100644 --- a/quick-start +++ b/quick-start @@ -10,16 +10,11 @@ mvn clean install -Pmodules -Dmaven.test.skip=true echo "[Step 2] Generate Eclipse project files for all projects" mvn eclipse:clean eclipse:eclipse -Pall - -echo "[Step 3] Start H2 Standalone database." -cd support/h2 -mvn exec:java -PwithoutBrowser & -cd ../../ -echo "[Step 4] Init schema and data for all example projects." +echo "[Step 3] Init schema and data for all example projects." mvn antrun:run -Prefresh-db,examples -echo "[Step 5] Start all example projects." +echo "[Step 4] Start all example projects." cd examples/mini-service mvn clean jetty:run -Djetty.port=8082 & cd ../mini-web diff --git a/quick-start.bat b/quick-start.bat index 9d195d31..46f8e774 100644 --- a/quick-start.bat +++ b/quick-start.bat @@ -13,16 +13,11 @@ echo [Step 2] Generate Eclipse project files for all projects call %MVN% eclipse:clean eclipse:eclipse -Pall if errorlevel 1 goto error -echo [Step 3] Start H2 Standalone database. -cd support/h2 -start "H2 Database" %MVN% exec:java -PwithoutBrowser -cd ..\..\ - -echo [Step 4] Init schema and data for all example projects. +echo [Step 3] Init schema and data for all example projects. call %MVN% antrun:run -Prefresh-db,examples if errorlevel 1 goto error -echo [Step 5] Start all example projects. +echo [Step 4] Start all example projects. cd examples\mini-service start "Mini-Service" %MVN% clean jetty:run -Djetty.port=8082 if errorlevel 1 goto error diff --git a/support/h2/README.txt b/support/h2/README.txt index 4a52e08d..e0dc0b1c 100644 --- a/support/h2/README.txt +++ b/support/h2/README.txt @@ -1 +1 @@ -Command to run a standalone H2 Database server. \ No newline at end of file +Command to open a H2 web console or run a standalone H2 Database server. \ No newline at end of file diff --git a/support/h2/h2-console.bat b/support/h2/h2-console.bat new file mode 100644 index 00000000..3f8fe4fe --- /dev/null +++ b/support/h2/h2-console.bat @@ -0,0 +1,3 @@ +@echo off +call mvn exec:java -Ph2console +pause \ No newline at end of file diff --git a/support/h2/h2-server.bat b/support/h2/h2-server.bat index 13e01b59..191b6e1e 100644 --- a/support/h2/h2-server.bat +++ b/support/h2/h2-server.bat @@ -1,3 +1,3 @@ @echo off -call mvn exec:java +call mvn exec:java -Ph2server pause \ No newline at end of file diff --git a/support/h2/pom.xml b/support/h2/pom.xml index 93ae16bd..a458c051 100644 --- a/support/h2/pom.xml +++ b/support/h2/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 org.springside @@ -8,8 +9,8 @@ ../../ org.springside - h2-starts - H2 start Script + h2-start + H2 Console pom @@ -21,59 +22,59 @@ - - - - org.codehaus.mojo - exec-maven-plugin - - - - java - - - - - org.h2.tools.Server - - -tcp - -web - -webPort - 8090 - -browser - - - - - - withoutBrowser - - - - org.codehaus.mojo - exec-maven-plugin - - - - java - - - - - org.h2.tools.Server - - -tcp - -tcpAllowOthers - -web - -webPort - 8090 - - - - - + h2server + + + + org.codehaus.mojo + exec-maven-plugin + + + + java + + + + + org.h2.tools.Server + + -tcp + -tcpAllowOthers + + + + + - + + + h2console + + + + org.codehaus.mojo + exec-maven-plugin + + + + java + + + + + org.h2.tools.Server + + -web + -webPort + 8090 + -browser + + + + + + +