Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Can you please recommend me some DB for learning JDBC?

 
Rancher
Posts: 157
5
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there!
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.

Thank you!
 
Saloon Keeper
Posts: 23441
159
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 30
2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mike,

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.

https://www.codecademy.com/learn/learn-sql

or try these:

https://dev.mysql.com/doc/mysql-getting-started/en/

https://dev.mysql.com/doc/refman/8.0/en/installing.html

https://docs.oracle.com/javase/tutorial/jdbc/basics/index.html

https://www.codejava.net/java-se/jdbc/connect-to-mysql-database-via-jdbc

https://youtube.com/playlist?list=PLEAQNNR8IlB4R7NfqBY1frapYo97L6fOQ

Hope that helps.
 
Mike Savvy
Rancher
Posts: 157
5
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you hit problems then post the issues here.
There's not much point leaping between DB trying to find one that works if there's something fundamentally incorrect about the set up.
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic