Library whose main objective is to generate connections to databases compatible with Java, for each bank there is a class with unit tests that guarantees consistency and quality.
The first version includes a connection to the MySQL
For the next versions are planned connections with:
-
Documentation: Javadoc
-
Author: Samuel Ricardo Cabral de Barros
-
Documentation: Javadoc
-
Created: 01/2021
-
Last update: 01/2021
-
State: In Progress
-
Current version: 1.0.0
-
License: GNU General Public License v3.0
-
If you are working with a Maven project, look for the
pom.xml
file in your Maven project -
Inside this file, look for the tag:
<dependencies>
</dependencies>
- And paste this code snippet into it...
<dependency>
<groupId>com.samuel.cabral</groupId>
<artifactId>ConnectionFactory</artifactId>
<version>1.0.0</version>
</dependency>
2-1. If you don't have this tag in your pom.xml, paste this snippet at the end of the code before the tag < /project >
:
<dependencies>
<dependency>
<groupId>com.samuel.cabral</groupId>
<artifactId>ConnectionFactory</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
- After doing this, execute the
build
in your application and it will be ready to be used with all dependencies installed...
- If your project is not Maven and you prefer to download it ...
-
download this file: ConnectionFactory-1.0.0.jar
-
After downloading, add the downloaded file to your project.
WARNING: Remember, when choosing this method you should download the JDBC and add it to your project, I will leave a list with the JDBC of the databases compatible with this version and the download links:
- MySQL - MySQLConnector 8.0.22
- MySQL:
- Import the MySQLConnectionFactory class:
import static com.MySQL.Connection.MySQLConnectionFactory.*;
-
now call the
getConnection (...)
method, the method will connect to the database and return a Connection -
When you want to close a connection, call the
closeConnection (...)
method