Derby classpath can't connect to database

蓝咒 提交于 2019-12-05 08:26:01

There are many troubles when I start using DerbyDB. It is really painful to practice.

1. For example, I download Derby from http://db.apache.org/derby/derby_downloads.html#Latest+Official+Releases

2. Unzip to C:\tools\db-derby-10.11.1.1-bin.


3. Press Windows key + R, type: SystemPropertiesAdvanced, set up environment variables.


Reference: https://db.apache.org/derby/docs/10.0/manuals/getstart/gspr16.html


4. Run cmd, We should run additional command:

C:\tools\db-derby-10.11.1.1-bin\bin\NetworkServerControl.bat

and type:

C:\tools\db-derby-10.11.1.1-bin\bin\ij.bat

then press Enter, and result:


5. We will put in-memory Derby database to D:\ directory. Folder vy1 must doesn't exit. We type command for creating new database named vy1:

connect 'jdbc:derby:D:\vy1;create=true';

Use Windows Explorer, go to directory D:\vy1, you will see new folder named vy1 just created.

then type command:

connect 'D:\vy1'


6. See SQL command to create database, table, insert, then read database like this:

(Open images in new web page is better for view. Note: This is my old screenshot when I use older version few months ago).

Come back to your question, focus at section 3, and commnand call NetworkServerControl.bat at section 4.

Good luck! :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!