-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d515990
commit 0ad5f27
Showing
47 changed files
with
1,378 additions
and
856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ | |
* @author Collin Alpert | ||
*/ | ||
public interface IdentifiableEnum { | ||
long getId(); | ||
int getId(); | ||
} |
79 changes: 79 additions & 0 deletions
79
src/main/java/com/github/collinalpert/java2db/database/ConnectionConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.github.collinalpert.java2db.database; | ||
|
||
/** | ||
* A container for database access. Contains all necessary information for this library to access a database. | ||
* | ||
* @author Collin Alpert | ||
*/ | ||
public class ConnectionConfiguration { | ||
|
||
/** | ||
* Specifies the hostname/ip address of the database. | ||
*/ | ||
private final String host; | ||
|
||
/** | ||
* Specifies the name of the database to connect to. | ||
*/ | ||
private final String database; | ||
|
||
/** | ||
* Specifies the username to log in on the database with. | ||
*/ | ||
private final String username; | ||
|
||
/** | ||
* Specifies the password to log in on the database with. | ||
*/ | ||
private final String password; | ||
|
||
/** | ||
* Specifies the port to connect to the database on. | ||
* This property is optional. If not specified, it will be set to 3306, the default port of MySQL. | ||
*/ | ||
private final int port; | ||
|
||
/** | ||
* Specifies the login timeout to the database in seconds. Default is 5 seconds. | ||
*/ | ||
private final int timeout; | ||
|
||
public ConnectionConfiguration(String host, String database, String username, String password) { | ||
this(host, database, username, password, 3306, 5); | ||
} | ||
|
||
public ConnectionConfiguration(String host, String database, String username, String password, int port, int timeout) { | ||
this.host = host; | ||
this.database = database; | ||
this.username = username; | ||
this.password = password; | ||
this.port = port; | ||
this.timeout = timeout; | ||
} | ||
|
||
public String getHost() { | ||
return host; | ||
} | ||
|
||
public String getDatabase() { | ||
return database; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public int getPort() { | ||
return port; | ||
} | ||
|
||
public int getTimeout() { | ||
return timeout; | ||
} | ||
|
||
|
||
} |
37 changes: 0 additions & 37 deletions
37
src/main/java/com/github/collinalpert/java2db/database/ConnectionPool.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.