Nicolas
Nicolas

Reputation: 331

Is there a way to add a local database to a netbeans java project package?

I have a java project I need to write that reads data in from a comma delimited text file.

But, for extra credit we can use a database instead of a text file .

I dont want to pay for a host or deal with servers.

So, is there a way to create a database that is in my java package so I can use sql?

I'm using netbeans (if it matters).

I need everything to be in my java package so when I turn it in to my teacher he doesn't need to download extensions or do anything special.

Upvotes: 1

Views: 551

Answers (3)

Basil Bourque
Basil Bourque

Reputation: 339561

What you are asking for is referred to as an embedded database, as opposed to a database server.

Besides JavaDB/Apache Derby mentioned in the correct answer by Lesya, another choice would be H2. Both are built in pure Java and can be bundled with your app. While both H2 and Derby are good options, you might find H2 is easier to learn, configure, and bundle.

Upvotes: 2

Farvardin
Farvardin

Reputation: 5424

You should use serverless DBMS such as SQLite and Apache Derby.

Upvotes: 1

Olesya Razuvayevskaya
Olesya Razuvayevskaya

Reputation: 1168

Probably, you are looking for something like JavaDB. It supports SQL queries

More on the configuration can be found here:

https://netbeans.org/kb/docs/ide/java-db.html#configuring

Upvotes: 1

Related Questions