Learn To Connect and Manage Integrated Databases


show more Connecting to multiple databases provides you with in-depth training on Developer. Taught by David Gassner as part of the Java Database Integration with JDBC show less
please wait ...

Connecting to multiple databases

To make it easier to switch between databases. I'm going to re-factor the code that I have written so far, so I can easily switch from MySQL to HSQL by simply passing in a single argument to a method. My goal is to show that once you have a connection, the code you use to make a request to the database and process the results is almost exactly the same from one database platform to another. I'm working in a project called MultiConnect where I have versions of the Main class that I have already coded in other projects.

I have one class that connects to MySQL, and I'll test that and make sure that it's working, and I have one that's connecting to HSQL, and I'll test that as well. Now, I have created a separate Utility class called DBUtil which only currently has some commented out code. I'm going to uncomment that code, and you'll see that there are four private strings, a username and a password, which will be usable on both databases because I have set it up so tha...

Connecting to multiple databases
Video duration: 6m 24s 2h 51m Intermediate

Viewers:

Connecting to multiple databases provides you with in-depth training on Developer. Taught by David Gassner as part of the Java Database Integration with JDBC

Subject:
Developer
Software:
Java
Author:
please wait ...