Cannot connect to embedded Derby database in IntelliJ IDEA because the database is in use

I am working on an application that uses an embedded database (Derby). My IDE is IntelliJ IDEA 14.1.3. I tried to create a database in the IDE:

Database> New> Data Source> Derby> Embedded

The database is created in Program Files, in the IDEA folder. However, I cannot access it:

Connection connection = DriverManager.getConnection("jdbc:derby:databaseName;create=true");

      

When I try to connect to the database (using the line above) it creates a new database in the project folder.

Is there a way to easily connect to the database from within the application and manage it in the IDEA Data Source Manager?

+3


source to share





All Articles