This commit is contained in:
insanity 2017-04-12 10:59:06 +09:00
parent ceb03cfb6b
commit e0f2de0565
7 changed files with 94 additions and 19 deletions

74
.gitignore vendored Normal file
View File

@ -0,0 +1,74 @@
# Created by .ignore support plugin (hsz.mobi)
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
.gitignore
.idea/
crawler.sql.iml
sql.iml
target/

View File

@ -11,10 +11,10 @@
</parent> </parent>
<groupId>com.loafle.overflow</groupId> <groupId>com.loafle.overflow</groupId>
<artifactId>sql</artifactId> <artifactId>crawler.sql</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<name>com.loafle.overflow.sql</name> <name>com.loafle.overflow.crawler.sql</name>
<dependencies> <dependencies>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
@ -31,7 +31,6 @@
<version>42.0.0</version> <version>42.0.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency> <dependency>
<groupId>com.microsoft.sqlserver</groupId> <groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId> <artifactId>mssql-jdbc</artifactId>
@ -47,7 +46,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.loafle</groupId> <groupId>com.loafle.overflow</groupId>
<artifactId>crawler_java</artifactId> <artifactId>crawler_java</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</dependency> </dependency>

View File

@ -1,4 +1,4 @@
package com.loafle.overflow.sql; package com.loafle.overflow.crawler.sql;
/** /**
* Created by insanity on 17. 4. 11. * Created by insanity on 17. 4. 11.

View File

@ -1,4 +1,4 @@
package com.loafle.overflow.sql; package com.loafle.overflow.crawler.sql;
import com.loafle.overflow.crawler.Crawler; import com.loafle.overflow.crawler.Crawler;
@ -15,8 +15,10 @@ public class SQLCrawler extends Crawler {
public SQLCrawler() {} public SQLCrawler() {}
public Object get(String id) {
TargetInfo info = getTargetInfo(id); @Override
protected Object getInternal(Map<String, Object> config) {
TargetInfo info = getTargetInfo(config.get("id").toString());
return getMetrics(info); return getMetrics(info);
} }
@ -24,17 +26,17 @@ public class SQLCrawler extends Crawler {
TargetInfo info = new TargetInfo(); TargetInfo info = new TargetInfo();
// //MySQL // //MySQL
info.setUrl("jdbc:mysql://192.168.1.215:3306"); // info.setUrl("jdbc:mysql://192.168.1.215:3306"); // ?useSSL=true&verifyServerCertificate=false
info.setId("root"); // info.setId("root");
info.setPw("qwe123");
info.setSSL(false);
info.setQuery("show session status");
// //MSSQL
// info.setUrl("jdbc:sqlserver://192.168.1.106:1433");
// info.setId("sa");
// info.setPw("qwe123"); // info.setPw("qwe123");
// info.setSSL(false); // info.setSSL(false);
// info.setQuery("select * from master.dbo.sysprocesses"); // info.setQuery("show session status");
// //MSSQL
info.setUrl("jdbc:sqlserver://192.168.1.103:1433;integratedSecurity=SSPI;encrypt=false;trustServerCertificate=true");
info.setId("sa");
info.setPw("qwer5795");
info.setSSL(true);
info.setQuery("select * from master.dbo.sysprocesses");
// //PGSQL // //PGSQL
// info.setUrl("jdbc:postgresql://192.168.1.107:5432/postgres"); // info.setUrl("jdbc:postgresql://192.168.1.107:5432/postgres");
// info.setId("postgres"); // info.setId("postgres");

View File

@ -1,4 +1,4 @@
package com.loafle.overflow.sql; package com.loafle.overflow.crawler.sql;
/** /**
* Created by insanity on 17. 4. 11. * Created by insanity on 17. 4. 11.

View File

@ -1,7 +1,7 @@
package com.loafle.overflow; package com.loafle.overflow;
import com.loafle.overflow.sql.SQLCrawler; import com.loafle.overflow.crawler.sql.SQLCrawler;
import org.junit.Test; import org.junit.Test;
import java.util.List; import java.util.List;