Skip to content

Commit

Permalink
removed bad import
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadMoirai committed Jul 14, 2017
1 parent ec96aee commit 9d8c6c0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Samurai7.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Samurai7" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="com.github.breadmoirai" external.system.module.version="0.1" type="JAVA_MODULE" version="4">
<module external.linked.project.id="Samurai7" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="com.github.breadmoirai" external.system.module.version="0.2.1_ALPHA" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group 'com.github.breadmoirai'
version '0.2_ALPHA'
version '0.2.1_ALPHA'

sourceCompatibility = 1.8

Expand Down Expand Up @@ -53,11 +53,11 @@ task sourcesJar(type: Jar, dependsOn: classes) {
}

task jarMake{
doLast {
print ':jarMake Creating Jars..'
jar
sourcesJar
javadocJar
shadowJar
doFirst {
println ':jarMake Creating Jars..'
}
dependsOn jar
dependsOn sourcesJar
dependsOn javadocJar
dependsOn shadowJar
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
*/
package com.github.breadmoirai.samurai7.database;

import jdk.management.resource.ResourceId;
import org.jdbi.v3.core.ConnectionFactory;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.Jdbi;

import javax.sql.DataSource;
import java.sql.*;
import java.util.Arrays;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.function.Consumer;
import java.util.function.Function;

Expand All @@ -32,14 +31,11 @@
*/
public class Database {

private static final String PROTOCOL = "jdbc:derby:";
private static final String DB_NAME = "SamuraiDatabase";

private static Database INSTANCE;
private static Database instance;

public static Database get() {
if (INSTANCE == null) throw new NullPointerException("Database has not been created.");
return INSTANCE;
if (instance == null) throw new NullPointerException("Database has not been created.");
return instance;
}

private final Jdbi jdbi;
Expand All @@ -48,16 +44,16 @@ public static Database get() {
* Supply a connection to a database.
* <p>
* This can be used with a lambda expression as such:
* <code>
* <pre>
* <code>
* {@link com.github.breadmoirai.samurai7.database.Database}.create(() -> {@link java.sql.DriverManager}.{@link java.sql.DriverManager#getConnection(String) getConnection}("jdbc:derby:myDB;create=true"))
* </pre>
* </code>
* </pre>
*
* @param connectionFactory This is equivalent to a {@link java.util.function.Supplier Supplier}{@literal <Connection>}
*/
public static void create(ConnectionFactory connectionFactory) {
INSTANCE = new Database(Jdbi.create(connectionFactory));
instance = new Database(Jdbi.create(connectionFactory));
}

private Database(Jdbi jdbi) {
Expand Down

0 comments on commit 9d8c6c0

Please sign in to comment.