0

Im currently looking for databases that can be used on IntelliJ community. I have tried to use h2 but most of the configuration videos i have found require a plugin that is only available on the ultimate version. I have also tried MySQL but when i downloaded it, I got the error 'Could not load MySQL preference pane'. I have not used databases in the past so I am not too sure how to move on from here.

  • 2
    You should be able to use _any_ SQL database which has a JBDC connector JAR. Are you using Maven here? – Tim Biegeleisen May 08 '21 at 03:55
  • Please take some time to read [the help pages](http://stackoverflow.com/help), especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). Also please take the [tour] and read about [ask] good questions. Lastly please read [this question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). – Some programmer dude May 08 '21 at 04:02
  • 1
    It would be also worth mentioning what do you plan to use this database for. Intellij is just an IDE, you can edit SQL queries there, write code, etc. it should work with any DB. – Piotr May 08 '21 at 04:03
  • @Piotr Im using it to make a simple Online Banking System where the user can create an account, login, transfer and deposit money and this information should be saved, so if i were to close the java program and re-run it, it should pick up from where it left off. Also depending on the login information, only that accounts information should be edited. – Grewal_Creator May 08 '21 at 04:13
  • Where would a better place be to ask such a question? @Someprogrammerdude – Grewal_Creator May 08 '21 at 04:14
  • [The software recommendations SE](https://softwarerecs.stackexchange.com) site probably. – Some programmer dude May 08 '21 at 04:16
  • Nope. It would be closed there too. That site requires a clear specification of your software requirements. These requirements are far too vague. What you actually need is to stop watching videos, and start reading proper tutorials and textbooks. For example: https://docs.oracle.com/javase/tutorial/jdbc/TOC.html – Stephen C May 08 '21 at 07:08
  • In short ... do some more reading before you ask questions. (And kick the habit of trying to learn to program from youtube videos.) – Stephen C May 08 '21 at 07:12
  • For the specifics of how to connect to a particular (JDBC compatible) database from Java, refer to the respective JDBC driver documentation; e.g. https://dev.mysql.com/doc/connector-j/8.0/en/ for MySQL. – Stephen C May 08 '21 at 07:17

1 Answers1

0

DBA work

IntelliJ Ultimate edition includes the functionality of the otherwise separate DataGrip product sold by the same company, JetBrains. The DataGrip functionality is for advanced database administration and interactive SQL sessions.

You do not need this DataGrip functionality to write database apps (though it certainly is helpful and enjoyable).

JDBC programming

➥ If your goal is writing Java code that uses JDBC to exchange data with a SQL database, then either the Community edition (free-of-cost) or the Ultimate edition (commercial product) of IntelliJ will work well.

All you need is to configure your project with the JDBC driver appropriate to your chosen database engine/server.

H2 Database Engine

If you choose H2 Database Engine, that certainly will work with IntelliJ Community edition for JDBC work.

I personally have written several complete example apps posted as Answers here on Stack Overflow that show configuring a DataSource to provide connections to H2, writing SQL to create a table, and more SQL to populate the table with data while also retrieving that data in a ResultSet. Such as this, this, this, this, and this. These examples would all work with Community edition of IntelliJ.

I have written similar examples for Postgres and for MySQL (like this), also posted here. Others folks have written such examples as well. Just search Stack Overflow to learn more. Tip: Learn to use site:stackoverflow.com as a criterion with your favorite search engine. The Stack Overflow built-in search feature is weak and is biased towards Questions rather than Answers.

For just starting out and learning, I would indeed suggest H2 Database Engine. I suggest that product because it is the easiest to initially install and start using. Just add one library to your project, either manually or via a dependency manager tool such as Apache Maven or Gradle. The H2 library comes with its own JDBC driver built-in.

Later, for doing productive work, you may want to consider other database products. Each database product has its strengths and weaknesses, ditto for JDBC drivers. So choose the product that best fits your particular project’s needs.

Plugins

You said:

most of the configuration videos i have found require a plugin

I have no idea what plugin you might have in mind. There is no need for any IDE plugin to use IntelliJ Community edition to write Java apps using JDBC with a database.

Again, you can simply copy-paste the code in examples written by me or others into any IntelliJ project configured with H2 as a dependency. Nothing more to add.

DBaaS

You said:

I have also tried MySQL but when i downloaded it

As I said earlier, for starting out, I would recommend using H2 locally on your own computer.

If you decide to try another database product, nowadays I would suggest not installing the database locally on your own computer. At least not early on while learning. Installing a database locally can be a chore, can require some education to make installation decisions, and can be difficult to uninstall.

Nowadays you have a wealth of choices of vendors offering Database-as-a-Service, also known as cloud database, and also known as managed databases. Several of the most popular database products have been adapted to being offered on virtual cloud servers. These include Postgres, Microsoft SQL Server, MySQL, Oracle Database, DB2, and more. Vendors include Digital Ocean, Heroku, Amazon Web Services (AWS), Microsoft Azure, IBM, and more.

You simply ask the vendor to spin up a new database, and voilà, a minute later you have a database ready for you to access over the internet.

The cloud database services do cost money. But most offer a free sample. And all of them are very inexpensive for a small server that is short-lived, mere pennies per hour.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154