/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package nl.fontys.sofa.limo.api.database;

public abstract class AbstractDBServer<S> implements DBServer<S> {

    protected S connection;

    @Override
    public S getConnection() {
        checkConnection();
        
        return connection;
    }

    @Override
    public abstract void closeConnection();

    /**
     * Checks if the connection object exists, and whether the connection is open. Creates and opens
     * connection if needed.
     */
    protected abstract void checkConnection();

}

@@ -1,189 +1,4 @@
-/*%0A * To change this license header, choose License Headers in Project Properties.%0A * To change this template file, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0A
 pack
@@ -182,44 +182,8 @@
 ) %7B%0A
-        checkConnection();%0A        %0A
     
@@ -355,16 +355,23 @@
 ction is
+%0A     *
  open. C
@@ -386,23 +386,16 @@
 nd opens
-%0A     *
  connect

update db access