Derpath classpath can not connect to databse

I just installed derby, and I followed the instructions here exactly as I was told, but replacing the paths with my paths. But for some reason why I am trying to create a connection to connect to the creation of a database and run my sql scripts to create tables and populate them, it gives me some errors, firstly, 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 don’t 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, which was necessary, so I see no problem, does anyone know what I did wrong? Also when i run

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

The server starts normally

 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 
+5
sql database derby jdbc
source share
1 answer

I have a lot of problems when I start using DerbyDB. It really hurts to practice.

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

2. Unzip C:\tools\db-derby-10.11.1.1-bin . enter image description here


3. Press the Windows key + R , type: SystemPropertiesAdvanced , configure the environment variables. enter image description here
Link: https://db.apache.org/derby/docs/10.0/manuals/getstart/gspr16.html


4. Run cmd . We have to execute an additional command:

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

and enter:

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

then press Enter , and the result: enter image description here


5. We will put the Derby database in memory in the D:\ directory. The vy1 folder vy1 not exit . We enter a command to create a new database named vy1 :

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

Use Windows Explorer, go to the directory D:\vy1 , you will see the newly created new folder with the name vy1 .

then enter the command:

 connect 'D:\vy1' 


6. See the SQL command to create the database, table, insert, and then read the database as follows:

enter image description here

(Opening images on a new web page is better for viewing. Note: This is my old screenshot when I used the older version a few months ago).

Return to your question in section 3 and call NetworkServerControl.bat in section 4.

Good luck! :)

+1
source share

All Articles