h2

简易年历

梦想与她 提交于 2019-12-05 14:02:07
简易年历 1 <style type="text/css"> 2 * { padding: 0; margin: 0; } 3 li { list-style: none; } 4 body { background: #f6f9fc; font-family: arial; } 5 6 .calendar { width: 210px; margin: 0 auto; padding: 10px 10px 20px 20px; background: #eae9e9; } 7 .calendar ul { width: 210px; overflow: hidden; padding-bottom: 10px; } 8 .calendar li { float: left; width: 58px; height: 54px; margin: 10px 10px 0 0; border: 1px solid #fff; background: #424242; color: #fff; text-align: center; cursor: pointer; } 9 .calendar li h2 { font-size: 20px; padding-top: 5px; } 10 .calendar li p { font-size: 14px; } 11 12

APDPlat如何自动建库建表并初始化数据?

▼魔方 西西 提交于 2019-12-05 13:53:09
APDPlat 共支持10种数据库:DB2、DERBY、H2、HSQL、INFORMIX、MYSQL、ORACLE、POSTGRESQL、SQL_SERVER、SYBASE。 数据库的默认配置信息在文件APDPlat_Core/src/main/resources/org/apdplat/db.properties中定义,用户可以根据自己的选择,在APDPlat_Web/src/main/resources/db.local.properties配置文件中覆盖默认配置。 1、如何指定使用哪一种数据库呢? jpa.database=MYSQL jpa.database 配置项的值可为上述10种数据库之一,10种数据库的JDBC驱动已经集成到APDPlat中,其中5种定义到maven配置文件APDPlat_Web/pom.xml的依赖中,其余5种放置在APDPlat_Web/src/main/webapp/WEB-INF/lib目录中。 2、如何配置数据库连接信息呢? #mysql db.driver=com.mysql.jdbc.Driver db.url=jdbc:mysql://localhost:3306/${module.short.name}?useUnicode=true&characterEncoding=UTF-8&createDatabaseIfNotExist

PARTITION BY doesn't work in H2 db

此生再无相见时 提交于 2019-12-05 13:39:53
I'm using PARTITION BY clause to do sorting on the result. Details for using PARTITION BY is mentioned in this question Sql Order by on multiple column . It works fine when i run in Oracle. I'm using H2 db for my unit test cases. When i run the same query on H2 db, it doesn't work. Is it known issue in H2? Is there any alternate solution which can work in Oracle and H2 both. I don't think H2 supports window functions (aka analytic functions). However, you can do the query in the link using standard SQL: SELECT t.* FROM yourtable t join (select vendorname, max(incidentdate) as maxdate from

Browse Corda database tables using H2 web interface shows synonyms errors

老子叫甜甜 提交于 2019-12-05 12:53:57
I followed the instructions at this link to browse corda database. However, I am getting below errors when I queried for tables. Error: Table "SYNONYMS" not found; SQL statement: SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS, TYPE_CAT, TYPE_SCHEM, TYPE_NAME, SELF_REFERENCING_COL_NAME, REF_GENERATION, SQL FROM (SELECT SYNONYM_CATALOG TABLE_CAT, SYNONYM_SCHEMA TABLE_SCHEM, SYNONYM_NAME as TABLE_NAME, TYPE_NAME AS TABLE_TYPE, REMARKS, TYPE_NAME TYPE_CAT, TYPE_NAME TYPE_SCHEM, TYPE_NAME AS TYPE_NAME, TYPE_NAME SELF_REFERENCING_COL_NAME, TYPE_NAME REF_GENERATION, NULL AS SQL FROM

jhipster liquibase validation error after modify entity

拟墨画扇 提交于 2019-12-05 12:43:12
I was trying to add an field to my entity as a CLOB. When using the JHipster CLI it was no problem to add it. Now, when i trying to start my application i get the following validation error from liquibase: liquibase.exception.ValidationFailedException: Validation Failed: 1 change sets check sum config/liquibase/changelog/20170221193921_xxxxxxxx.xml::20170221193921-1::jhipster was: 7:d8b3f42d8d4d523c7b14f93b4c7657c7 but is now: 7:a2a365179a0d231c2771ebd79f51b1fc i also tried the following: ./mvnw liquibase:clearCheckSums The result was BUILD SUCCESS . i also tried ./mvnw liquibase:update and

Hibernate and H2 “Referential integrity constraint violation” for OneToMany bidirectional mapping

流过昼夜 提交于 2019-12-05 12:30:20
问题 So I have two simple beans -- FatKid and Hamburgers. Now, for reasons unbeknownst to me I need to be able to not only look up all of the hamburgers someone ate, but also who ate which particular hamburger. Onto the code! FatKid.java import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence

Flyway migrations not persistent in H2 embedded database

泄露秘密 提交于 2019-12-05 11:24:37
I'm actually writing a small web application with spring boot and wanted to use a (embedded) H2 database together with Spring Data JPA and Flyway for database migration. This is my application.properties: spring.datasource.url=jdbc:h2:~/database;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1; spring.datasource.username=admin spring.datasource.password=admin spring.datasource.driver-class-name=org.h2.Driver In the main() method of my @SpringBootApplication class I do the following: ResourceBundle applicationProperties = ResourceBundle.getBundle("application"); Flyway flyway = new Flyway(); flyway

Installing and starting the H2 database on Ubuntu

青春壹個敷衍的年華 提交于 2019-12-05 10:48:22
I would like to use the H2 database on Ubuntu 12.10, and went to the website and got the platform independent install file. The installation instructions are quite literally, "To install the software, run the installer or unzip it to a directory of your choice." I'm not a Linux novice, so I've used many of the usual install procedures before, but I have no idea what I am supposed to do here. There are no configure or makefiles that I can find, and the documentation doesn't mention anything, and there I can't find anything using google. I don't know if I am missing something obvious. Can

Play Framework: Error getting sequence nextval using H2 in-memory database

心不动则不痛 提交于 2019-12-05 10:31:21
As the title suggests, I get an error running Play 2.0.1 Tests using a FakeApplication w/ H2 in memory. I set up a basic unit test: public class ModelTest { @Test public void checkThatIndustriesExist() { running(fakeApplication(inMemoryDatabase()), new Runnable() { public void run() { Industry industry = new Industry(); industry.name = "Some name"; industry.shortname = "some-name"; industry.save(); assertThat(Industry.find.all()).hasSize(1); } }); } Which yields the following exception: [info] test.ModelTest [error] Test test.ModelTest.checkThatIndustriesExist failed: Error getting sequence

Adding the NOT_NULL constraint to an SQL column

纵然是瞬间 提交于 2019-12-05 10:26:44
I'm trying to add the NOT_NULL constraint to a column in an SQL h2 database, using ALTER TABLE CHARACTERS ADD CONSTRAINT nn_PID NOT_NULL (PLAYER_ID); This follows the pattern I found here : ALTER TABLE Persons ADD CONSTRAINT pk_PersonID PRIMARY KEY (P_Id,LastName) Except I change the constraint, table and column names. But I get this error: Syntax error in SQL statement "ALTER TABLE CHARACTERS ADD CONSTRAINT NN_PID NOT_NULL[*] (PLAYER_ID) "; expected "., COMMENT, PRIMARY, INDEX, KEY, CHECK, UNIQUE, FOREIGN"; SQL statement: ALTER TABLE CHARACTERS ADD CONSTRAINT nn_PID NOT_NULL (PLAYER_ID)