Creating/Configuring Derby JDBC Client in IntelliJ Idea 13

一笑奈何 提交于 2019-12-05 16:35:47

I've managed to get this work. Here are the steps that I've made to successfully configure local Derby database to work in IntelliJ Idea 13/14.

  1. First, you need to manually start derby server (if it is not already running) before using it in IDEA. I usually do it via command prompt by typing:

    C:\Users\PcName>startNetworkServer -noSecurityManager

    This command will start derby server on port number: 1527. Make sure you have correctly set path in enviroment variables

  2. Next go to IDEA, open Database window, click on the green plus sign in the upper left corner and in the dropdown menu choose: Data Source -> Derby -> Remote

  3. You can inspire with my settings provided in the screenshot in my question. You can also download Derby driver files. IDEA does it just by clicking on the download button.

    Basic template which I always use is something like that:

    Name field should be in the form: Derby - YourDatabaseName;create=true@localhost

    Host field should have localhost inside

    Port has to be 1527

    Database field has to be in form: YourDatabaseName;create=true

    Urc to connect: jdbc:derby://localhost:1527/YourDatabaseName;create=true

  4. (Optional) - You can specify your database user name and password. In IDEA 14 there is a checkbox Save on disk with master password protection, which I personally always leave unchecked.

That's it. I hope this little guide will help somebody to configure Derby in Intellij IDEA

I think that for a local (embedded) database, you would leave off the host and port in the connection url.

The documentation says that the url should be of the form: jdbc:derby:MallDB;create=true

For embedded database, use the default/In-Memory/URL only select box on the right side of the connection URL input field. When set to In-Memory, it generates the following URL, which works for me.

 jdbc:derby:memory:MallDB;create=true
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!