1

I've been trying to connect to an Apache Derby/JavaDB embedded database using Oracle SQL Developer but without much success.

I've tried to create a new connection using the following JDBC URL:

jdbc:derby:/path/to/file/database.derby;create=true

which resulted in an error:

Status : Failure -Test failed: Invalid connection info specified. Verify the URL format for the specified driver.

Previously I've added derby.jar through Tools > Preferences > Database > Third Party JDBC Drivers.

Given that JavaDB is now a supported Oracle product I'm not understanding why is not better integrated with its development tools.

Any guidance will be much appreciated. Thanks in advance.

Dave
  • 4,546
  • 2
  • 38
  • 59
Nano Taboada
  • 4,148
  • 11
  • 61
  • 89

2 Answers2

1

Your derby url seems wrong. You need to point the url to the directory of the database, not the database itself.

jdbc:derby:/path/to/file/;create=true

Have a look at the examples.

jdbc:derby:/reference/phrases/french

Open a connection to the database /reference/phrases/french.

On a UNIX system, this would be the path of the directory. On a Windows system, the path would be C:\reference\phrases\french if the current drive were C. If a jar file storing databases were in the user's classpath, this could also be a path within the jar file.

From the docs:

The connection URL syntax is as follows:

jdbc:derby:[subsubprotocol:][databaseName][;attribute=value]

Subsubprotocol, which is not typically specified, determines how Derby looks for a database: in a directory, in memory, in a class path, or in a jar file. Subsubprotocol is one of the following:

directory: The default. Specify this explicitly only to distinguish a database that might be ambiguous with one on the class path.

oers
  • 18,436
  • 13
  • 66
  • 75
0

try connecting to the Derby DB using the Eclipse Java EE IDE for Web Developers instead of Oracle SQL Developer. In the latest versions it is has the full integrations.

cane
  • 892
  • 1
  • 10
  • 16