Embedded DB

H2

macro 2010. 3. 23. 16:24
반응형


===== 특징 =====

  * JDBC API로 사용. pure java 이므로 C 로는 사용 못함.
  * 구글앱 에서 사용
  * http://www.h2database.com/html/main.html
  * H2 supports row level locks when using multi version concurrency.
  * embedded mode, server mode, mixed mode 가 가능하므로, 임베디드 DB를 다른 프로세스가 억세스 할 수 있는 장점이 있다. 따라서 데이터 insert는 임베디드로 하고 쿼리는 서버모드로 접근가능함.
  * http://www.h2database.com/html/features.html#products_work_with
  * To backup data while the database is running, the SQL command SCRIPT can be used.

  * 웹브라우저로 환경설정 가능함. 특히 리모트로 접속가능하게 하려면, preferences 에서 Allow connections from other computers 선택한다.

===== In memory 사용시 =====

  * Sometimes multiple connections to the same in-memory database are required. In this case, the database URL must include a name. Example: jdbc:h2:mem:db1. Accessing the same database in this way only works within the same virtual machine and
class loader environment.
  * In-memory can be accessed remotely (or from multiple processes in the same machine) using TCP/IP or SSL/TLS. An example database URL is: jdbc:h2:tcp://localhost/mem:db1.
  * By default, closing the last connection to a database closes the database. For an in-memory database, this means the content is lost. To keep the database open, add ;DB_CLOSE_DELAY=-1 to the database URL. To keep the content of an in-memory database as long as the virtual machine is alive, use jdbc:h2:mem:test;DB_CLOSE_DELAY=-1.


 

반응형