From ffdba7956c92caeaa7b293d38d3b1ab895660e7a Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Tue, 13 Dec 2016 14:19:27 +0100 Subject: [PATCH] Cleaned code. --- src/fr/devinsy/sikevadb/sql/SQLSikevaDB.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/fr/devinsy/sikevadb/sql/SQLSikevaDB.java b/src/fr/devinsy/sikevadb/sql/SQLSikevaDB.java index 98508df..d913abe 100644 --- a/src/fr/devinsy/sikevadb/sql/SQLSikevaDB.java +++ b/src/fr/devinsy/sikevadb/sql/SQLSikevaDB.java @@ -51,6 +51,7 @@ import fr.devinsy.util.StringList; public class SQLSikevaDB implements SikevaDB { private static final Logger logger = LoggerFactory.getLogger(SQLSikevaDB.class); + private String driverClassname; private String url; private String login; @@ -77,7 +78,6 @@ public class SQLSikevaDB implements SikevaDB */ public SQLSikevaDB(final String driverClassName, final String url, final String login, final String password) { - if (StringUtils.isBlank(driverClassName)) { throw new NullPointerException("driverClassName is null."); @@ -1994,22 +1994,18 @@ public class SQLSikevaDB implements SikevaDB @Override public void open() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException, NamingException { - // close(); // if (this.url != null) { - // Class.forName(this.driverClassname).newInstance(); this.singleConnection = DriverManager.getConnection(this.url, this.login, this.password); logger.info("Single connection opened with [{}].", this.url); - } else if (this.contextName != null) { - // Context initialContext = new InitialContext(); Context environmentContext = (Context) initialContext.lookup("java:comp/env"); this.dataSource = (DataSource) environmentContext.lookup(this.contextName); @@ -2027,15 +2023,12 @@ public class SQLSikevaDB implements SikevaDB @Override public void put(final Element element) throws SQLException { - - // if (element == null) { throw new IllegalArgumentException("element is null."); } else { - // if (exists(element)) { // @@ -2135,14 +2128,12 @@ public class SQLSikevaDB implements SikevaDB @Override public void put(final String key, final String value) throws SQLException { - // Element element = getElement(key); // if (element == null) { - // element = new Element(); element.setKey(key); element.update(value); @@ -2150,7 +2141,6 @@ public class SQLSikevaDB implements SikevaDB } else { - // element.update(value); } @@ -2209,7 +2199,6 @@ public class SQLSikevaDB implements SikevaDB @Override public void put(final String key, final String subkey, final String value) throws SQLException { - // Element element = getElement(key, subkey); @@ -2431,7 +2420,6 @@ public class SQLSikevaDB implements SikevaDB @Override public void renameKey(final String oldKey, final String newKey) throws SQLException { - logger.info("renameKey starting... [{}][{}]", oldKey, newKey); // @@ -2464,7 +2452,6 @@ public class SQLSikevaDB implements SikevaDB @Override public void replaceInValue(final String key, final String... tokens) throws SQLException { - logger.info("replaceInValue starting... [{}]", key); // @@ -2489,7 +2476,6 @@ public class SQLSikevaDB implements SikevaDB @Override public void replaceInValues(final String key, final String... tokens) throws SQLException { - logger.info("replaceInValues starting... [{}]", key); //