Dylan Benton
Dylan Benton

Reputation: 109

Derby DB not finding tables

I've connected to an embedded database but I am having trouble with the program finding the tables created. Is anyone able to pick out the issue? I have included the screenshot below.

issue

or if that's too small, a link here

https://i.sstatic.net/oBBNV.png

EDIT It works fine using the client Driver and new Connection but not embedded. Any Ideas why?

I'm going to make a program that holds records on a single computer so I'm trying to keep it all together.

Upvotes: 1

Views: 668

Answers (1)

Holger
Holger

Reputation: 298233

You are very likely to see different databases. You are using the embedded driver which does not support connections from different JVMs. So you can’t see the same database in your IDE and your stand-alone application.

But both applications can have a different current directory against which your database name “sample” is resolved. Since you already ran your application with the create=true option that second database now exists. So it doesn’t help removing this option now.

In order to connect to the right database you have to either provide the full path to the database or change the current directory before connecting. But you will have to close the IDE’s connection if you use the embedded drivers though.

Upvotes: 4

Related Questions