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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:18:16+00:00 2026-06-15T09:18:16+00:00

My aim is to create a local database that can be read and written

  • 0

My aim is to create a local database that can be read and written to with Java. I have some experience with manipulating a local sqlite database with Python, and with interacting with existing networked databases on Microsoft Azure via VB.Net, but the Java formulation for creating a database is escaping me.

Most sources (like the JDBC Docs) seem to assume that you are accessing a database through a network protocol, or a database hosted on localhost. My desired implementation is to create and store the database in a file (or collection of files), so that it can be stored and accessed locally, without network connectivity (presumable through the “file:” protocol).

The JDBC Tutorial looks like it will be very useful once I am up and running, but is currently beyond my scope, since I don’t even have an existing database yet.

Many sources have suggested solutions like H2, MySQL, Derby, or Hypersonic DB. However, I’m loath to install extensions (if that’s the right term) for a number of reasons:

  • This project is initially intended to help me learn my way around Java – widening the scope of the project will dilute my experience with the “base” language and, probably, increase the temptation to engage in “cargo cult programming”
  • If this project does ever get distributed to other users (admittedly unlikely, but still!), I don’t want to force them into installing more than the core of Java.
  • I simply don’t know how to install extensions (add-ons? modules?) in Java – one baby-step at a time!

For similar reasons, installing Microsoft SQL Server would not be productive.

This answer looks close to what I’m aiming for; however, it gives the error:

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/?user=root&password=rootpassword

and trying “jdbc:file://targetFile.sql” gives a similar error.

I’ve seen the term “embedded” database, which I think is a subset of “local database” (i.e. a local database is stored on the same system – an embedded database is a local database that is only used by a single application) – if I’ve got those definitions wrong, please feel free to correct me!

  • 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-15T09:18:17+00:00Added an answer on June 15, 2026 at 9:18 am

    Most likely, the reason for which you are getting the error, is due to the fact that you are not registering the driver (using reflection…) before actually using it for establishing a connection and so on.

    Presumably you will want to do something along the lines of Class.forName("driver")

    and then cast that if necessary and then registering it in the DriverManager before calling the getConnection() method.

    Here is a very useful link that might help you out in solving the issue:

    http://www.kfu.com/~nsayer/Java/dyn-jdbc.html

    However, if you really want to use a local database/file you might want to have a look at SQLite, that might be one way to go about it, although I recommend going for the MySQL approach, as it is a lot easier to configure and learn how stuff works with JDBC.

    If you are still considering SQLite check this out:

    Java and SQLite

    I see you need some guidance in importing external .jar files into your code (i.e. 3rd party libraries like the ones you will be using for a JDBC driver). Are you using an IDE (e.g. Eclipse, Netbeans, etc.) or are you writing in a text editor and compiling manually?

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

Sidebar

Related Questions

I'm working on a simple crawler in Python. The aim is to create a
What I can do: I aim to create a view where a User Control
My aim is to create an application whereby a user can drag a label
My overall aim is to create an editor which I can skin using jQuery
I'm looking to create a database system that help keep projects I'm working on
My aim is to create identify a piece of code that increments a number
I have acquired Digital Elevation Maps(Height Map of Earth) of some area. My aim
Aim: to create an Infopath form that displays a list of companies in a
I aim to create a browser game where players can set up buildings. Each
To put this in concise language... Aim: To create a class which can load

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.