Apache Derby手记
遗憾没有管理员账号,不能够安装MySQL。更不要说那些Oracle,DB2,SQL Server那些巨无霸了。
偶然找到了Derby,绿色的,符合JDBC标准的纯Java的数据库,体积细小,移植性好,不用安装,挺爽的。
1 下载:
1.1 http://db.apache.org/derby/
1.2 解压
2 安装
2.1配置DERBY_HOME环境变量
2.2配置相关的Path和ClassPath
3 运行(三种方式)
3.1命令行 java -jar %DERBY_HOME%\lib\derbyrun.jar ij [-p propertiesfile] [sql_script]
ij.bat是一个jdbc连接的工具
基本语法:
CONNECT 'jdbc:derby:firstdb;create=true';
CREATE TABLE FIRSTTABLE (ID INT PRIMARY KEY, NAME VARCHAR 12));
INSERT INTO FIRSTTABLE VALUES (10,'TEN'),(20,'TWENTY'),(30,'THIRTY');
SELECT * FROM FIRSTTABLE;
run 'ToursDB_schema.sql';
exit;
3.2自带脚本
3.3开发程序运行
4 JDBC连接数据库
4.1内嵌Jdbc驱动:程序中添加derby.jar
String driver = "org.apache.derby.jdbc.EmbeddedDriver";
String dbName = "jdbcDemoDB";
String connectionURL = "jdbc:derby:" + dbName + ";create=true";
Class.forName(driver);
4.2 client driver and Network Server 使用c/s架构的derby驱动连接
项目添加derbyclient.jar
运行服务器java -jar %DERBY_HOME%\lib\derbyrun.jar server start
String driver = "org.apache.derby.jdbc.ClientDriver";
String dbName = "jdbcDemoDB";
String connectionURL = "jdbc:derby://localhost:1527/" + dbName + ;create=true";
5 JDBC URL
jdbc:derby://server[:port]/databaseName[;URLAttributes=value[;...]]
6主要脚本
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.
分享到:
相关推荐
收集的学习资料,包括:Derby数据库(V10.9)用户手册(PDF版),用 Apache Derby 进行 Java 数据库开发,用 Apache Derby 进行数据库开发,03开源项目(三)嵌入式数据库Apache Derby(1)(开发指南).pdf ,Apache Derby ...
Apache Derby 10.2版手册集
Apache Derby是Apache软件基金会所研发的开放源码数据库管理系统;由于Derby是一个纯Java程式,因此只需要操作系统支援Java虚拟机,Derby便可执行。
Eclipse下Apache Derby 应用程序开发
嵌入式数据库Apache Derby是用 Java 语言编写的,所以可以在任何存在合适的 Java 虚拟机(JVM)的地方运行,Derby软件绑定在Java档案(JAR)文件中,只有2MB大小.
Apache Derby是Apache软件基金会所研发的开放源码数据库管理系统;由于Derby是一个纯Java程式,因此只需要操作系统支援Java虚拟机,Derby便可执行。
我在Apache Derby使用中遇到了以下问题,并解决了,现总结出来让像我这样的新手少走点弯路。
Apache Derby是Apache软件基金会所研发的开放源码数据库管理系统;由于Derby是一个纯Java程式,因此只需要操作系统支援Java虚拟机,Derby便可执行。
嵌入式数据库Apache Derby是用 Java 语言编写的,所以可以在任何存在合适的 Java 虚拟机(JVM)的地方运行,Derby软件绑定在Java档案(JAR)文件中,只有2MB大小.
Derby Developer's Guide. Purpose of this guide This guide explains how to use the core Derby technology and is for developers building Derby applications. It describes basic Derby concepts, such as ...
derby_core_plugin_10.2.1.452058 derby_ui_plugin_1.1.0
嵌入式数据库Apache+Derby开发指南
Apache Derby是Apache软件基金会所研发的开放源码数据库管理系统;由于Derby是一个纯Java程式,因此只需要操作系统支援Java虚拟机,Derby便可执行。
用 Apache Derby 进行开发 —— 取得节节胜利:介绍
apachederby纯java数据库的jar包
学习如何使用 Apache Derby、Apache MyFaces 和 Facelets 来开发 Java:trade_mark:Server:trade_mark: Faces (JSF) 应用程序。本文中示例应用程序使用了 Model-View-Controller (MVC) 架构,用来说明 MyFaces 组件的...
本文内容包括:ApacheDerby和Eclipse插件测试Derby数据库插件功能的简单代码资源索引插件结束语下载参考资料本文演示了如何将资源索引与ApacheDerby数据库结合使用来开发Eclipse插件。嵌入到Eclipse的Derby数据库使您...
Apache Derby是Apache软件基金会所研发的开放源码数据库管理系统;由于Derby是一个纯Java程式,因此只需要操作系统支援Java虚拟机,Derby便可执行。
Apache Derby是Apache软件基金会所研发的开放源码数据库管理系统;由于Derby是一个纯Java程式,因此只需要操作系统支援Java虚拟机,Derby便可执行。