Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8362671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:59:41+00:00 2026-06-09T11:59:41+00:00

For unit testing I use a derby in-memory database. Is there any chance to

  • 0

For unit testing I use a derby in-memory database.

Is there any chance to connect to this database using a tool like Eclipse Datasource Explorer when the test is running?

I googled a lot and sometimes I found something like:

Connection-URL: jdbc:derby://localhost:1527/memory/mydb…

But it did not work for me.

It says that 1527 is the default port.

Is it possible at all to connect to a derby memory database with a tool like eclipse explorer?
Does the database open a connection-port to connect to?
Or is there something special I have to configure for this to work?

Thanks,
Alex

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:59:42+00:00Added an answer on June 9, 2026 at 11:59 am

    Hi after some more research I got the solution.

    To connect to a embedded derby memory database you have to start the NetworkServerControl in your application. After that you are able to connect to the derby database by using for example the eclipse DTP Plugin / Datasource Explorer.

    The code to create the in-memory db and to start the NSC could look like this:

    public static void main(String args[])
    {
       NetworkServerControl nsc = new NetworkServerControl(InetAddress.getByName("localhost"), 1527);
       nsc.start(new PrintWriter(System.out, true));
    
       Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
    
       Connection c = DriverManager.getConnection("jdbc:derby:memory:testdb;create=true");
    
    }
    

    You have to include the derby.jar & derbynet.jar that comes with the jdk7 (lib\db) to be able to create the NetworkServerControl and the database.

    After that you can connect to the db as long as your application (and the database) is running.
    Connection-URL is: jdbc:derby://localhost:1527/memory:testdb

    User and Password: your choice

    Regards,

    Alex

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SQLite for the unit testing and might use it as a
I use Eclipse + Maven and - for unit testing purposes - the web
When unit testing, is it a must to use a database when testing CRUD
I am curious as to what people use for unit-testing and memory-testing tags in
Anyone using CodeIgniter use automated unit testing? Seems the way CodeIgniter's guy do unit
What type of applications did you use this TDD, unit testing approaching (web app,
When doing unit testing in Android activities using ActivityInstrumentationTestCase you could use TouchUtils to
I want to use xUnit with my project for unit testing. Am using Visual
For unit testing, I'm using NUnit 2.6 and Moq 4.0. There's a particular case
I use Test::Unit::Lite for unit testing in Perl. Now, this module looks for .pm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.