h2

What is the proper way to close H2?

不羁的心 提交于 2019-11-28 22:58:29
This is related to this post . I think I am having problem with H2 meaning that it does not close properly. I suspect this since I see myDB.lock.db when I shutdown tomcat and the process does not stop. I use Tomcat's connection pooling and the url to the database is: url="jdbc:h2:file:/opt/myOrg/tomcat/webapps/MyApplication/db/myDatabase;SCHEMA=myschema" From the doc close H2 : Usually, a database is closed when the last connection to it is closed.... By default, a database is closed when the last connection is closed. However, if it is never closed, the database is closed when the virtual

CSS语法与JSON、JS对象比较

爱⌒轻易说出口 提交于 2019-11-28 22:00:14
本文转载于: 猿2048 网站 CSS语法与JSON、JS对象比较 CSS(Cascading Style Sheets) 规则由2个部分构成:选择器,声明。    selector{declaration1;declaration2;declaration3;...declarationN}    declaration由分号(;)隔开, 表示为 property:value1 value2 ..是一种单层的无内嵌套的结构。    value为具体的某值如表示大小的px,颜色的#FFFFFF,position的relative/absolute等等    selector可以由多个选择器表示中间由逗号隔开如h1,h2,h3,h4.. 注: code CSS 要注意时属性的值要求有序与否   backgroud: color position size repeat attachment url("img.url") 这类属性 浏览器渲染解析时利用正则判断 value 的类型可达到修改指定属性,其顺序和 value 类型可随意搭配。    padding: left top right bottom 这类属性渲染时则是根据顺序解析,若要修改指定属性需补全其前面的值。 JSON(Javascript Object Nonation) 由对象声明构成。   {declaration1

Access to h2 web console while running junit test in a Spring application

淺唱寂寞╮ 提交于 2019-11-28 21:33:56
I'm building a Spring application and I need to inspect my H2 in-memory database while I'm running my JUnit tests from a web browser. In my Spring configuration I have a bean which is responsible of creating my database schema and populating it with some data which will be used within my JUnit tests. I've also added a bean in my test context which creates a web server where I eventually will look for my data. <bean id="org.h2.tools.Server-WebServer" class="org.h2.tools.Server" factory-method="createWebServer" init-method="start" lazy-init="false"> <constructor-arg value="-web,-webAllowOthers,

Start the H2 database in server mode via Spring

做~自己de王妃 提交于 2019-11-28 20:46:47
I'm trying to start the H2 database in server mode (I want it to run in a different process) via Spring. Currently I'm using java Runnable.exec to start the h2 database (using the command: " java -cp h2.jar org.h2.tools.Server ") I know that there is a way to do it via Spring. I tried to add the following to the spring configuration, but it didn't work (it didn't start the H2 database): <bean id="org.h2.tools.Server" class="org.h2.tools.Server" factory-method="createTcpServer" init-method="start" destroy-method="stop"> <constructor-arg value="-tcp,-tcpAllowOthers,true,-tcpPort,8043" /> </bean>

auto increment ID in H2 database

瘦欲@ 提交于 2019-11-28 19:30:54
问题 Is there a way to have an auto_incrementing BIGINT ID for a table. It can be defined like so id bigint auto_increment but that has no effect (it does not increment automatically). I would like to insert all fields but the ID field - the ID field should be provided by the DBMS. Or do I need to call something to increment the ID counter? 回答1: It works for me. JDBC URL: jdbc:h2:~/temp/test2 drop table test; create table test(id bigint auto_increment, name varchar(255)); insert into test(name)

How to configure spring-boot to use file based H2 database

情到浓时终转凉″ 提交于 2019-11-28 19:28:31
问题 I have successfully created a spring boot application that uses the H2 embedded database in-memory. I would now like to change this to a file based version that will persist. I have tried just changing the spring.datasource.* properties in my application.properties file and they look something like this: spring.datasource.url=jdbc:h2:file:~/test;DB_CLOSE_ON_EXIT=FALSE spring.datasource.username=test spring.datasource.password=test spring.datasource.driverClassName=org.h2.Driver` It seems like

Connect to H2 database using IntelliJ database client

馋奶兔 提交于 2019-11-28 18:33:16
My Grails app uses a h2 database in dev mode (the default behaviour for Grails apps). The DB connection settings in DataSource.groovy are dataSource { pooled = true jmxExport = true driverClassName = "org.h2.Driver" username = "sa" password = "" dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', '' url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" } I'm trying to setup a connection for this database using IntelliJ IDEA's database client tools. I start off creating the connection like so Then in the following dialog, I enter the JDBC

世纪经典案例之万年历

旧巷老猫 提交于 2019-11-28 17:40:23
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style type="text/css"> * { padding: 0; margin: 0; } li { list-style: none; } body { background: #f6f9fc; font-family: arial; } .calendar { width: 210px; margin: 0 auto; padding: 10px 10px 20px 20px; background: #eae9e9; } .calendar ul { width: 210px; overflow: hidden; padding-bottom: 10px; } .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; } .calendar li h2 { font-size: 20px; padding-top:

H2 database error: Database may be already in use: “Locked by another process”

落花浮王杯 提交于 2019-11-28 17:11:53
I am trying to use the H2 database from a Java application. I created the database and its tables through the H2 Console and then I try to connect from Java using Connection con = DriverManager.getConnection("jdbc:h2:~/dbname", "username", "password"); However I receive the following error: Exception in thread "main" org.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked by another process". Possible solutions: close all other connection(s); use the server mode [90020-161] I tried to delete the dbname.lock.db file but it is automatically re-created. How can I unlock the database

How do I avoid 'Could not determine Hibernate dialect for database name [H2]!'?

旧巷老猫 提交于 2019-11-28 14:09:09
I am getting this error when running grails run-app : Error executing bootstraps: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property