Java application with database installation

I want to create a Java application with a fairly small database. On the computer on which I want to install this, there is nothing from the database on his PC (without a Wamp server, without an oracle, nothing ...). I am new to such things and I don’t know if this has already been asked, but this is what I want to accomplish

Now I have a couple of questions:

  • Is this doable?
  • What should i use? Mysql, Oracle, ...
  • How can i do this?

I hope this is enough to get a decent answer.

+4
source share
5 answers
  • Yes, it is doable.
  • For use with Java, I highly recommend Apache Derby because
    • you have tremendous flexibility in choosing between the built-in and client-server , without refactoring the code necessary to change the data access mode.
    • over H2 or HSQLDB : in my experience, I found Apache Derby
      • to be much more reliable / stable (other built-in DBMSs tend to break more than derby in case of power failure).
      • consume less RAM
      • in order to have better performance in large deployments (many rows, a lot of data [in micro objects with small real data, H2 and HSQLDB can actually win better]).
      • be especially fast with select queries in multi-threaded environments
    • via MySql and PostgreSql
      • actually faster when you are not using a CPU / network, because I saw that in many cases it works better than in most cases (especially with large databases - say 10 GB) when it comes to accessing the file system (MySql and PostgreSql, however, are more efficient in terms of CPU / network usage when this is a limitation)
    • via MySql, PostgreSql, Oracle db, etc.
      • it is surprisingly fast (often faster), with very large databases (say, 30 GB) - something that cannot be expected from a DBMS can be implemented in any application without deployment / configuration
  • To get started, see

If you do not need clients from the network to connect remotely to your database, the built-in database is what you want to implement.


Fire Prevention Warning: All of the above statements are consistent with my personal experience, with the projects I worked on and / or the articles / tests that I read and trusted as reliable. Unless otherwise indicated (and in fact I am not specifying anywhere else :)), I mean fresh unmanaged uninstalled installations.

+2
source

Perhaps you should use a built-in database like H2 or HSQLDB . These are just simple libraries that you drop into your application, but they provide exactly the same JDBC interface.

You can use the full SQL database without any external dependencies. H2, my personal favorite, allows you to create both in memory and permanent databases, you can connect to it using a socket, it can set the web interface through the default port 8082, etc. On my developer's machine, I don’t even have a “normal” database, I always use H2.

+1
source

HSQL or use one of the SQLite JDBC adapters.

+1
source

I recommend using the Derby database. It is very easy to embed in a java application.

+1
source

How is this computer equipment? What is the processor memory and hard drive?

What is an OS? Do you have admin / root access?

If you have a typical Windows PC and have enough central processor, memory and hard drive.

I recommend you install mysql. Just download mysql for your OS and install it.

Download link:

http://www.mysql.com/downloads/mysql/

Here are the installation documents:

http://dev.mysql.com/doc/refman/5.5/en/installing.html

Good luck.

0
source

Source: https://habr.com/ru/post/1392531/


All Articles