I'm learning about JDBC for one week and I would like to test some queries on my PC in Eclipse.
But I have not accomplished to get connection to DB from Java code, all the time I had different Exceptions.
First I tried Derby because of recommendation in OCP book from Boyarsky, but it has not worked, also the book say it is in JDK but it is not.
Then I have installed MySQL the installation was successful, but I think I have not accomplished to communicate with it from Eclipse because of jar file. I had choosed it but the programm still dont liked it.
So maybe there are other DB's which I can easy install and try some stuff? Just for learning.
When you say "test DB connections in Eclipse", that can mean one of 2 things.
Eclipse has an optional database plugin that allows you to use Eclipse to make connections (via JDBC) to SQL database servers and run SQL and DDL commands and queries.
However, since Eclipse is also an application development environment (IDE), it is used to create JDBC applications. Since Java applications can run stand-alone, they don't depend on Eclipse for help and in this case you'd be using the Java debugger to run the app using a debugging (Run) profile.
The essential difference in terms of JDBC is that for the Eclipse database plugin, you have to tell the plugin where to find the JDBC driver jar(s) that you want it to use, then use the plugin GUI to define JDBC connections that you'd issue your SQL commands through.
In contrast, when testing/running a stand-alone JDBC application you would have to include the JDBC driver jar's location as part of the classpath you set up under the Run/debug menu dialog.
Depending on what database you are using, what OS you are using, and how you install things, the location of the database JDBC driver JAR could be located anywhere. For me, I'm using the Fedora Linux OS, and its standard software package installer for MySQL JDBC puts the jar in the /usr/share/java directory these days. The location of the driver really doesn't matter, though, as long as you point the application you are using at it.
If you get error messages, however, please tell us what the text of those messages is. We can help you much better that way.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.
Apache Derby and MySQL should be your best choices. Both have a lot of tutorials and documentation available. I would recommend try to troubleshoot your installation, make sure everything is set up correctly, correct driver, permissions, network, server is running, etc., and follow any number of tutorials (video and/or text) freely available. If you just want to learn SQL syntax, codecademy has a decent free SQL course.
Thank you for answers Tim Holloway and David Gillette.
Tim, I posted already some exceptions I became here: https://coderanch.com/t/738266/certification/set-Database-code-OCP-study David, thank you for links, I will use each of them. Codeacademy course I did in 2019 but I can say I have not learned a lot there, it is pretty little. And I need deeper knowledge of database, sql and jdbc.
I hope the tutorial from youtube will help, because I used already some tutorials for mysql from internet (2020 version) but it had not worked with eclipse (also not in terminal).