Skip to content

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.

License

Notifications You must be signed in to change notification settings

Samuel-Ricardo/ConnectionFactory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConnectionFactory

Badge Badge Badge

Badge Badge Badge

Badge

Badge Badge Badge

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:

General Information:

To Use the Library

Maven Project:

  1. If you are working with a Maven project, look for the pom.xml file in your Maven project

  2. Inside this file, look for the tag:

<dependencies>
	
</dependencies>
  1. 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>
  1. After doing this, execute the build in your application and it will be ready to be used with all dependencies installed...

Project without Maven

  • If your project is not Maven and you prefer to download it ...
  1. download this file: ConnectionFactory-1.0.0.jar

  2. 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:

How to create a connection:

  • MySQL:
  1. Import the MySQLConnectionFactory class:
import static com.MySQL.Connection.MySQLConnectionFactory.*;
  1. now call the getConnection (...) method, the method will connect to the database and return a Connection

  2. When you want to close a connection, call the closeConnection (...) method