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 7764087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:49:20+00:00 2026-06-01T14:49:20+00:00

Good day! I’m new in using Java DB (Derby). I want to embed it

  • 0

Good day!

I’m new in using Java DB (Derby). I want to embed it to my application.
I found this website (http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javadb/) and followed the instructions. I copied parts of the sample code and edited to fit my class.

When I run the class, it returns this error:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:435)
at java.util.Properties.load0(Properties.java:354)
at java.util.Properties.load(Properties.java:342)
at recordbook.ui.RecordBookDAO.loadDBProperties(RecordBookDAO.java:40)
at recordbook.ui.RecordBookDAO.<init>(RecordBookDAO.java:28)
at recordbook.ui.RecordBook.<init>(RecordBook.java:34)
at recordbook.ui.RecordBookUI.<init>(RecordBookUI.java:23)
at recordbook.ui.RecordBookUI$3.run(RecordBookUI.java:214)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
at java.awt.EventQueue.access$000(EventQueue.java:96)
at java.awt.EventQueue$1.run(EventQueue.java:608)
at java.awt.EventQueue$1.run(EventQueue.java:606)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
BUILD SUCCESSFUL (total time: 3 seconds)

This is the part of the class where it gets the NullPointerException:

    private Properties dbProperties = null;
    private final String dbName;

    public RecordBookDAO(String recordBookName)  {
        this.dbName = recordBookName;
        setDBSystemDir();
        dbProperties = loadDBProperties();
        String driverName = dbProperties.getProperty("derby.driver"); 
        loadDatabaseDriver(driverName);
        createDatabase();
    }

    private Properties loadDBProperties() {
        InputStream dbPropInputStream = null;
        dbPropInputStream = RecordBookDAO.class.getResourceAsStream("Configuration.properties");
        dbProperties = new Properties();
        try
        {
            dbProperties.load(dbPropInputStream);
        }
        catch (IOException ex)
        {
            ex.printStackTrace();
        }
        return dbProperties;
    }

The complete code for the class is available at: http://dl.dropbox.com/u/34926392/RecordBookDAO.java
Your help is much appreciated! Thank you in advance.

  • 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-01T14:49:22+00:00Added an answer on June 1, 2026 at 2:49 pm

    You are getting NULL at

    dbPropInputStream = RecordBookDAO.class.getResourceAsStream("Configuration.properties");
    

    Check that configuration.properties exists.

    If your properties file is in the same directory as the class you use to call “getResourceAsStream(“”)”, then you just need the name of the file, without the absolute path to it.

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

Sidebar

Related Questions

Good day. I just want to consult about using websphere as san application server
Good day! I want to show all the pictures in the folder, but this
Good day! I've found this solution here: VS2010 Web Publish command line version of
Good day! I tried using JSTL in java but there's an error: exception javax.servlet.ServletException:
Good day everyone, I am building a page in ASP.NET, and using Master Pages
Good day, I am using CacheFilter to filter a certain path to my server
Good day everyone. I am working on a Firefox extension, and I want to
Good day! I want to add and remove CSS files according to the size
Good day everyone, this is one of those areas that is a little over
Good day everyone. I have a question about making and using derived classes of

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.