From 94f168567b5d7330aad3e4dcf7e9f891470327e1 Mon Sep 17 00:00:00 2001 From: "jackdaw@loafle.com" Date: Fri, 14 Apr 2017 10:39:33 +0900 Subject: [PATCH] param map => Config --- .../loafle/overflow/crawler/sql/SQLCrawler.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java b/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java index 996a004..def016e 100644 --- a/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java +++ b/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java @@ -1,6 +1,7 @@ package com.loafle.overflow.crawler.sql; import com.loafle.overflow.crawler.Crawler; +import com.loafle.overflow.crawler.config.Config; import java.sql.*; import java.util.ArrayList; @@ -16,24 +17,25 @@ public class SQLCrawler extends Crawler { public SQLCrawler() {} @Override - public Object getInternal(Map config) { + public Object getInternal(Config config) { return getMetrics(config); } - private Object getMetrics(Map config) { + private Object getMetrics(Config config) { Connection conn = null; Statement stmt = null; ResultSet rs = null; try { - conn = DriverManager.getConnection( - (String)config.get("url"), - (String)config.get("user"), - (String)config.get("pw")); +// conn = DriverManager.getConnection( +// (String)config.get("url"), +// (String)config.get("user"), +// (String)config.get("pw")); + stmt = conn.createStatement(); - rs = stmt.executeQuery((String)config.get("query")); +// rs = stmt.executeQuery((String)config.get("query")); ResultSetMetaData md = rs.getMetaData(); int cnt = md.getColumnCount();