Derby类路径不能连接到数据库 [英] Derby classpath cant connect to databse

查看:1114
本文介绍了Derby类路径不能连接到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚安装了derby,我按照




4。运行 cmd
我们应该运行额外的命令:

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

并输入:

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

,然后按 Enter ,结果:




5。 Derby数据库到 D:\ 目录。文件夹 vy1 必须不退出。我们键入用于创建名为 vy1 的新数据库的命令:

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

使用Windows资源管理器,转到目录 D:\vy1 ,您将看到刚刚创建的名为 vy1

的新文件夹。



然后键入命令:

  connect'D:\vy1'


6。查看SQL命令创建数据库,表,插入,然后读取数据库,如下所示:





注意:这是我的旧屏幕截图,当我使用旧版本几个月前)。



回到您的问题,焦点在第3节,并在第4节调用 NetworkServerControl.bat



祝你好运! :)


I just installed derby and I followed the instructions from here the exact same way it told me to but replacing the paths with my paths. But for some reason why i try to create a connection to connect to create a Database and run my sql scripts to create the tables and populate them it gives me a few errors firstly is this one

ERROR 08001: No suitable driver found for jdbc:derby:SuperMarket;create=true

Then when my sql scripts run I get this error

IJ ERROR: Unable to establish connection

I dont see what I did wrong this is the line i used to set the class path

C:\> set CLASSPATH=%DERBY_INSTALL%\lib\derby.jar;%DERBY_INSTALL%\lib\derbytools.jar;.

I included the derby.jar file that was needed so I cant see the problem does anyone know what I did wrong? Also when I run

 connect 'jdbc:derby://localhost:1527/MyDB';

The server starts fine

C:\Derbs\db-derby-10.10.2.0-bin\bin>startNetworkServer
Thu Jun 26 11:56:38 PDT 2014 : Security manager installed using the Basic server
 security policy.
Thu Jun 26 11:56:39 PDT 2014 : Apache Derby Network Server - 10.10.2.0 - (158244
6) started and ready to accept connections on port 1527

解决方案

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! :)

这篇关于Derby类路径不能连接到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆