Attempting to Move from NetBeans to IntellaJ & Having DataSource Connection Issues with Derby

 

I’m attempting to move from NetBeans to IntellaJ ….

 

And I have searched high and low over the web looking for my answer and I’ve spent the last day and a half working this issue.

 

I have a working JavaFX project on NetBeans. And I have copied this project into an IntellaJ JavaFX project which compiles clean.  

Then I started creating the DataSources to connect to all my databases.   I have DataSources that connect to a MySQL database, and a Postgres database without issue.

 

However, I cannot connect to my Derby database via IntellaJ.

 

I have followed the instructions to create a remote DataSource in IntellaJ and I continue to get an error message indicating:

 

          “Incorrect Driver and/or connection setting specified.”

 
This is griving me nutz !!!!!!!

Any assistance with this would be greatly appreciated.

I'm running Windows 10 Professional and have version 14.1.5 of IntellaJ IDEA

4 comments
Comment actions Permalink

What driver jars do you use? Attach a screenshot with your JDBC URL and other connection settings in IDEA.

What error do you get? Attach idea.log.

0
Comment actions Permalink

Thanks for responding Serge .....

Here are two screen shots (attached).... I'm new to IntellaJ and have no idea about where any logs for the activity would be located .... If it is easy to setup these logs please let me know and I'll see about getting some logs for you.

Please let me know if you can't view the attachments .....

I have NetBeans running now and I'm viewing rows in a table in the Derby database ..... so I know that Derby is up and running and I can see data (from netbeans anyway) ....

Basically I do the following from the Database Window:

1.  Click the "+" sign to Add a new Derby Remote DataSource.

2.  Make these entries in the Database Tab:

     Host: localhost
     Port: 1527
     Database: w1smcsat
     
     The above configures a URL of jdbc:derby://localhost:1527/w1smcsat

     User: w1smc
     Password: the password for the database

Note: The Driver files section of the DataSource dialog indicates I am,  "Using Derby / Remote driver files".  And when I click on the highlighted "Derby / Remote" it displays the Remote Driver Template that lists the following:
          

              C:\Users\W1SMC\.IntelliJIdea14\config\jdbc-drivers\derby-license.txt

              C:\Users\W1SMC\.IntelliJIdea14\config\jdbc-drivers\derbyclient-10.11.1.1.jar
              C:\Users\W1SMC\.IntelliJIdea14\config\jdbc-drivers\derby-10.11.1.1.jar

    Then when I click the "Test Connection" button it returns the Error Connection dialog box.

    When I get out of the DataSource and click on the Remote Driver that is listed it shows on the Settings tab a class name of org.apache.derby.jdbc.EmbeddedDriver.  Even if I select the org.apache.derby.jdbc.ClientDriver from the dropdown list for the class name and go back and test the connection I continue to get the same error.

    Thanks for helping.

    Steve



    Attachment(s):
    IJ_screenshot02.png
    IJ_screenshot01.png
    0
    Comment actions Permalink

    Serge,

    Thanks for the information about finding the log files ..... I went thought them and they did help ....

    I went back and determined that I could run my JavaFX project in IntellaJ and get access to my Derby database ONLY when I had NetBeans running and also I had connected to my database while in Netbeans ..... Isn't that interesting ....

    However, I still could not configure an IntellaJ DataSouce successfully ..... And I tried many different things ....

    So after a good nights sleep I attacked this problem with a vengence beginning at 5 AM this morning .....

    Well I seemed to have finally peiced it all together .....

    When I tried configuring a DataSource in IntellaJ it returned with either a message indicating I could not connect to my database (because I hadn't started the Derby Network Server) OR after starting the server that it could not find my database.

    So after hours of trying different things I finally found a discussion on the web about starting the Derby Network Server and telling it where my database was located.  This made sense because when I connected to my database using NetBeans my database configuration setup has a "Database Location" input parm.  So NetBeans was telling the server when it was started where to find my database.  And when I connected and started the server using NetBeans I could access my database when I ran my project in IntellaJ without issue.

    So, how do you tell the Derby Network Server the location of the database to point to?

    There is an environment variable, DERBY_OPTS, that you set and pass this setting to the Derby Network Server.

    Specifically, in Windows, I opened up a DOS window and used the command .... set DERBY_OPTS=-Dderby.system.home=I:\Databases\Derby\w1smcsat

    I then started the server and ran my IntellaJ project without issue.

    I then went back and configured my DataSource and I was able to connect to my database without issue.

    So ..... I do have to manually start the Derby Network Server prior to doing any testing in IntellaJ but I also have to do that in NetBeans.

    If you have any questions please let me know .....

    Thanks so much for assisting me in this endevor.  It's nice to know there are those out there willing to help.

    Steve

    0

    Please sign in to leave a comment.