Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction and usage of Derby Database

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "the introduction and usage of Derby database". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the introduction and usage of Derby database.

I. introduction of Derby database

Derby is a transaction and relational database written in pure Java, which takes up very little disk space. Derby originated from CloudScape, a product that IBM acquired from Informix. In 2004, IBM decided to open source CloudScape to become an incubator project under Apache Software Foundation, called Derby. The practical benefit of using Derby is that it requires minimal management and small resource footprint. The database on disk is relatively small, and for the basic database, it is about 2MB. The fact that there is least management allows developers to easily create and use databases in their code. This accelerates development. Deployment is so easy because Derby supports the storage of data libraries archived in JAR files, which makes you only need to distribute JAR files.

Since the release of Java 6 JDK on July 13, 2006, Derby has been installed by default in C:\ Program Files\ Java\ jdk1.6.0\ db, which contains core libraries, demonstration programs, and sample databases.

II. Installation and configuration

With the JDK environment configured, do the following:

1. Download the latest version of Derby database first

Derby official home page: http://db.apache.org/derby/index.html

Derby download page: http://db.apache.org/derby/derby_downloads.html

To install Derby, you must first download the latest version of zip or tar package of Derby from Derby's website. The latest version is 10.4.2.0.

Distributions are as follows:

The binary distribution includes code, sample programs, and documentation. The optimized jar documents are in the lib directory

The lib distribution includes an optimizer, a collection of minimum jar for deploying Derby.

The lib-debug distribution includes a maximum set of useful tools for debugging Derby and reporting problems.

The src distribution includes the source files to generate the above three distributions.

To install Derby, simply unzip the package file you downloaded to the directory you specified.

Suppose you are downloading a binary distribution.

Extract the downloaded package, followed by the following subdirectories:

-- demo includes sample programs

-- bin includes code to run and set up the environment

-- javadoc includes aip documents produced with source code

-- doc includes Derby documents

-- lib includes Derby's jar file

What I downloaded is: db-derby-10.3.1.4-bin.zip

two。 Extract the db-derby-10.3.1.4-bin.zip into a directory, and here I am C:\ Derby\ db-derby-10.3.1.4-bin

3. Check "system Properties"-"Advanced"-"Environment variables". Under "system variables", create a new variable "DERBY_INSTALL", which is the path value of step 2 C:\ Derby\ db-derby-10.3.1.4-bin.

4. Add "% DERBY_INSTALL%\ lib\ derby.jar;%DERBY_INSTALL%\ lib\ derbytools.jar;" to CLASSPATH

5. Enter the Derby installation directory "% DERBY_INSTALL%\ frameworks\ embedded\ bin" and double-click the run file setEmbeddedCP.bat

6. To test whether the Derby database environment is configured successfully, open a command prompt window and enter the information "java org.apache.derby.tools.sysinfo", such as the following:

C:\ Documents and Settings\ Administrator > java org.apache.derby.tools.sysinfo

-Java information-

Java version: 1.5.0u12

Java supplier: Sun Microsystems Inc.

Java home directory: C:\ Program Files\ Java\ jdk1.5.0_12\ jre

Java classpath:.; C:\ Program Files\ Java\ jdk1.5.0_12\ lib;C:\ Program Files\ Java

\ jdk1.5.0_12\ lib\ dt.jar;C:\ Program Files\ Java\ jdk1.5.0_12\ lib\ tools.jar;C:\ Derby

\ db-derby-10.3.1.4-bin\ lib\ derby.jar;C:\ Derby\ db-derby-10.3.1.4-bin\ lib\ derbytoo

Ls.jar;C:\ Program Files\ Microsoft SQL Server 2000 Driver for JDBC\ lib\ msbase.jar

; C:\ Program Files\ Microsoft SQL Server 2000 Driver for JDBC\ lib\ mssqlserver.jar

C:\ Program Files\ Microsoft SQL Server 2000 Driver for JDBC\ lib\ msutil.jar;C:\ Pro

Gram Files\ MySQL\ mysql-connector-java-5.0.7-bin.jar;C:\ Program Files\ Apache Soft

Ware Foundation\ Tomcat 5.5\ common\ lib\ servlet-api.jar;C:\ Program Files\ Libs\ dom4

J-1.6.1.jar

OS name: Windows XP

OS architecture: x86

OS version: 5.1

Java user name: Administrator

Java user home directory: C:\ Documents and Settings\ Administrator

Java user directory: C:\ Documents and Settings\ Administrator

Java.specification.name: Java Platform API Specification

Java.specification.version: 1.5

-Derby information-

JRE-JDBC: J2SE 5.0-JDBC 3.0

[C:\ Derby\ db-derby-10.3.1.4-bin\ lib\ derby.jar] 10.3.1.4-(561794)

[C:\ Derby\ db-derby-10.3.1.4-bin\ lib\ derbytools.jar] 10.3.1.4-(561794)

-locale information-

Current language environment: [Chinese / China [zh_CN]]

Find a supported locale: [cs]

Version: 10.3.1.4-(561794)

Find a supported locale: [de_DE]

Version: 10.3.1.4-(561794)

Find a supported locale: [es]

Version: 10.3.1.4-(561794)

Find a supported locale: [fr]

Version: 10.3.1.4-(561794)

Find a supported locale: [hu]

Version: 10.3.1.4-(561794)

Find a supported locale: [it]

Version: 10.3.1.4-(561794)

Find a supported locale: [ja_JP]

Version: 10.3.1.4-(561794)

Find a supported locale: [ko_KR]

Version: 10.3.1.4-(561794)

Find a supported locale: [pl]

Version: 10.3.1.4-(561794)

Find a supported locale: [pt_BR]

Version: 10.3.1.4-(561794)

Find a supported locale: [ru]

Version: 10.3.1.4-(561794)

Find a supported locale: [zh_CN]

Version: 10.3.1.4-(561794)

Find a supported locale: [zh_TW]

Version: 10.3.1.4-(561794)

At this point, I believe you have a deeper understanding of "the introduction and usage of Derby database". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report