tags: Knowledge

Apache Derby is written in JavaOpen source embedded relationship databaseIt is very small. The core part of Derby.jar is only 2m, so it can be used as a separate database service or embedded in the application.
The main feature of Derby is:
Apache Derby's official website providesDownload page.
Select 10.14.2.0 here

After clicking the version connection, click to download DB-DERBY-10.14.2.0-BIN.ZIP file

After the download is complete

Next, you need to set the environment variable of Derby, set the derby_home to the directory after decompression, and add the derby_home/bin to the PATH environment variable
Then enter IJ in the CMD window

Apache Derby supports two deployment methods: embedded (Embedded) or client/server mode (Client/Server)
Derby runs in the JVM of the Java application, and the Java application drives the database through Embedded Derby JDBC. At this time, Derby belongs to part of the Java application, and the Java application starts and closed. Users cannot perceive the existence of Derby, and usually do not need to be configured and manage.

Derby runs in the server JVM, and multiple applications are connected to the Derby database through the network. At this time, Derby Network Server is responsible for managing connection requests from the client. The client is connected to the server through the Derby Network Client JDBC driver.

IJ is an interactive SQL script tool for operating the Derby database.
Create a database through the IJ tool
ij> connect 'jdbc:derby:xxoo;create=true';
Create = true in the connection indicates a new database, name XXOO
ij> connect 'jdbc:derby:xxoo';
ij> create table test(id int primary key, name varchar(50));
Have been inserted/renew/delete 0 Row
ij> insert into test values(1, 'apple'),(2, 'banana');
Have been inserted/renew/delete 2 Row
ij> select * from test;
ID |NAME
--------------------------------------------------------------
1 |apple
2 |banana
chosen 2 Row
ij> run 'myfile.sql';
The run command will print and execute the content in the script file.
ij> disconnect;
ij>
ij> exit;
If you want to exit the IJ tool, use the exit command;For embedded mode, the command will turn off the database at the same time.
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.14.2.0</version>
</dependency>
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
Connection conn = DriverManager.getConnection("jdbc:derby:xxoo;create=true");
JDBC introduction and use
First, the introduction of Derby database 1. Overview of Derby's development history and characteristics Derby is an open source, 100% relational database developed by Java. With the popularity of the...
The above error occurred during the SpringCloud project. Analysis: The error is missing the four elements of the data link, possible reasons, really did not write four elements, write wrong, The analy...
When using IDEA to integrate the spring cloud project, in order to test load balancing and whether the provider and the user can communicate successfully, a provider producer1 is created first, and my...
The derby database sets the password trick. The first thing to use is the visualization tool that comes with NetBeans. Create a database The database name is: derbyTest. Username: test. Passwor...
In the maven pom files modified in the configuration file location, error on startup: Solution: Modify the startup classSpringBootApplicationNotes are:...
Solve the error Right-click resources, select MarkDirectorys as, and select resource root. Just restart it!...
wrong reason The mybatis-spring-boot-starter is introduced in the pom. Spring boot will load the org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration class by default. The DataSourc...
The database file is not configured, such as the yml file in spring-boot....
error code wrong reason: The automated configuration of the data source is triggered, but the current project does not require a data source. The root cause is the API dependencies provided by the dep...
1. Problem description: Error reporting the SpringBoot project time, the problem description is as follows: 2. Reason: Introduced mybatis-spring-boot-starter coordinates in POM, Spring Boot will load ...