Apache Derby

来自开放百科 - 灰狐
跳转到: 导航, 搜索
Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Apache Derby Thanks, Wikipedia.
Derby-logo.png

目录

简介

Apache Derby 是用 Java 语言编写的,所以可以在任何存在合适的 Java 虚拟机(JVM)的地方运行。这意味着 Derby 实际上可以在任何操作系统上运行,包括 Microsoft Windows®、Macintosh、Linux® 和 UNIX® 平台。Derby 也可以在三个 Java 平台的任何一个上运行:Java 2 Platform, Micro Edition (J2ME)、Java 2 Platform, Standard Edition (J2SE) 和 Java 2 Platform, Enterprise Edition (J2EE)。Derby 软件绑定在 Java 档案(JAR)文件中,只有 2 MB 大小。由于内存占用这么小,所以 Derby 数据库可以容易地与应用程序绑定在一起。

可以用两种方式使用 Derby 数据库:

  • 作为内嵌的数据库,用户并不知道数据库的存在。应用程序使用数据库,二者在同一个 JVM 中运行,而数据库把数据保存在本地文件系统中。在内嵌模型中,数据库只与运行在同一 JVM 中的应用程序通信。
  • 作为客户机-服务器连接,是许多商业厂商使用的更传统的模型。在这种模型中,应用程序通过网络连接与数据库通信,应用程序和数据库分别在各自的 JVM 中运行。数据库服务器可以与多个客户机应用程序通信。

历史

1996 年,一个叫做 Cloudscape, Inc 的新公司成立了,公司的目标是构建一个用 Java 语言编写的数据库服务器。公司的第一个发行版在一年之后推出,后来产品的名称变成 Cloudscape。
1999 年,Cloudscape, Inc. 被大型数据库厂商 Informix Software, Inc. 收购。
2001 年, Informix Software 又被 IBM 收购,然后 IBM Cloudscape™ 数据库系统在许多 IBM 的产品中被用作内嵌的数据库引擎。
2004 年 4 月,IBM 把 Cloudscape 数据库软件赠送给 Apache 软件基金会(ASF),从此 Apache Derby 项目诞生了。在 Apache 中这个项目叫做 Derby,它是一个孵化器项目。开发人员可以在 Apache 的许可下为 Derby 代码作出贡献,或者下载 Derby 代码。从 Cloudscape Version 10 开始,IBM 的 Cloudscape 解决方案都以 Derby 代码为基础。
可以从 IBM 下载 Cloudscape。下载 Cloudscape 不需要任何许可费用,但是可以从 IBM 购买对它的支持。

最新版

Derby 10.3.1.4 runs on the following platforms:

  • JDK 1.4 and Java 5 - Here Derby supports the JDBC 3.0 interface.
  • Java 6 - Here Derby supports the JDBC 4.0 interface.
  • CDC/Foundation 1.1 - Here Derby supports the JSR 169 interface.

Install

get http://download.huihoo.com/apache/derby/
cd bin
export DERBY_HOME=/usr/local/db-derby-10.3.1.4-bin
./ij
ij> connect 'jdbc:derby:testdb;create=true';
ij> CREATE TABLE mytable (mycol INT);
ij> INSERT INTO mytable VALUES (1), (2), (3);
ij> prepare p1 AS 'INSERT INTO MyTable VALUES (4)';
ij> execute p1;
ij> CREATE INDEX i1 ON mytable(mycol);
ij> execute p1;
ij> exit;
copy demo/databases/toursdb /bin/toursdb
./ij
ij> connect 'jdbc:derby:toursdb';
ij> show tables;
....
APP                 |AIRLINES                      |                    
APP                 |CITIES                        |                    
APP                 |COUNTRIES                     |                    
APP                 |FLIGHTAVAILABILITY            |                    
APP                 |FLIGHTS                       |                    
APP                 |FLIGHTS_HISTORY               |                    
APP                 |MAPS                          |      

26 rows selected

Derby scripts

bin/dblook  // Runs the dblook tool.
bin/ij // Starts the ij tool.
bin/NetworkServerControl // Runs NetworkServerControl.
bin/setEmbeddedCP // Puts all of the Derby libraries for an embedded environment in the classpath.
bin/setNetworkClientCP // Puts the libraries needed to connect to the Derby Network Server into the classpath.
bin/setNetworkServerCP // Puts the libraries needed to start the Derby Network Server into the classpath.
bin/startNetworkServer // Starts the Network Server on the local machine.
bin/stopNetworkServer // Stops the Network Server on the local machine.
bin/sysinfo // Runs the sysinfo tool.

SQuirrel SQL

Using SQuirreL SQL Client with Derby - http://db.apache.org/derby/integrate/SQuirreL_Derby.html

相关链接

Comment-32x32.png

<discussion>characters_max=300</discussion>

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱