Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Whether you're building a web- or desktop-based application with Java SE or Java EE, many Java applications need to integrate data from a relational database. This course describes how to read and manage data from relational databases such as MySQL and SQL Server using the Java Database Connectivity (JDBC) API.
Author David Gassner explains how to choose a JDBC driver and connect to one or more databases. He also provides detailed instructions on reading, selecting, and updating data; calling stored procedures; managing data via JavaBean classes or with prepared statements; and working with metadata.
In order to make the coding of our exercise files consistent, I'm going to show you how to create a database user that has access to the MySQL database server, and we'll use the credentials for that user throughout the course. In phpMyAdmin go to the home-screen, from there click on the Users tab, depending on how you installed MySQL and what software bundle you used, you might see a variety of user identities in this list. Minimally, you should see one named root, which is the super user or administrator of the entire database server.
It's typically a good idea to create your own database users. So on this screen I'll click Add user. I'll set my username and password to some very simple easy to remember values. I'll set the User name to dbuser, all lowercase. For the Host, I'll pull down the list and choose Local, and that sets the host to localhost. I'll click into the Password, and I'll type a simple string of dbpassword, again, all lowercase, and I'll type it twice to make sure I got it right.
Now I'll scroll a little further down, and I'll click the Check All link, and that adds all privileges to this user. dbuser will be able to access all databases on the server and do anything that the database server allows. I'll go down to the bottom of the screen and click Add user, and I should see that my database user has been created. So that's the user identity that I'll use throughout all of these exercises. If you have any trouble connecting, you might try deleting the user and then re-creating it again and make sure that you type in the password carefully so that it's something you'll easily remember.
There are currently no FAQs about Java Database Integration with JDBC.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.