embulk-input-jdbc 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 240e726395f1ccd9d29bfc37dcb753efd299180f
4
- data.tar.gz: 2070e8347eb7a66808fa663d2a8b9945ef17be57
3
+ metadata.gz: 448f952857706e80263b5b4fb0fd0a0afb0bc932
4
+ data.tar.gz: 394b0a3d874564fa7c10e8141f157bc2b71486e6
5
5
  SHA512:
6
- metadata.gz: dcbfe8d42cb15917e76acf2443454610f4b52357ef1a287bfb860c1e4cdf7780dfc917ac01b9df5cb2f8586783aba3fc5a29b9b9ee3e6bf55a311889408c572b
7
- data.tar.gz: e69aa91bfb8c7cfd55eb9ca2dfd1bbc47036d6660124ffc1b4f72a773b3d5399b1b6fe5f9f0fcd3450c67119f3a9c52d350dbf9c6a513d505495aac8da832b0d
6
+ metadata.gz: 1a0ba32aa3c9ac2169130102fe85eb841c1da236a062a2bff9dcdc4196282d5237a1705261250c52f3234dfb279017dbb47e972325396abfceb685b3bc0b56d4
7
+ data.tar.gz: 174d493cad631c3bb15cf475ee7aa77aee4db10a4b40cc8350c4b31732517c54410110bafafe8454d3d52f4d364bd5df3571704ddbe3670db7a67be6c86cc880
data/README.md CHANGED
@@ -14,6 +14,7 @@ Generic JDBC input plugin for Embulk loads records from a database using a JDBC
14
14
  - **url**: URL of the JDBC connection (e.g. 'jdbc:sqlite:mydb.sqlite3') (string, required)
15
15
  - **user**: database login user name (string, optional)
16
16
  - **password**: database login password (string, default: optional)
17
+ - **ssl**: use SSL to connect to the database (string, default: `disable`. `enable` uses SSL without server-side validation and `verify` checks the certificate. For compatibility reasons, `true` behaves as `enable` and `false` behaves as `disable`.)
17
18
  - **schema**: destination schema name (string, default: use the default schema)
18
19
  - **fetch_rows**: number of rows to fetch one time (integer, default: 10000)
19
20
  - **connect_timeout**: not supported.
@@ -184,6 +184,8 @@ public abstract class AbstractJdbcInputPlugin
184
184
 
185
185
  Schema schema;
186
186
  try (JdbcInputConnection con = newConnection(task)) {
187
+ con.showDriverVersion();
188
+
187
189
  // TODO incremental_columns is not set => get primary key
188
190
  schema = setupTask(con, task);
189
191
  } catch (SQLException ex) {
@@ -7,6 +7,7 @@ import java.sql.ResultSet;
7
7
  import java.sql.ResultSetMetaData;
8
8
  import java.sql.SQLException;
9
9
  import java.sql.Statement;
10
+ import java.util.Locale;
10
11
  import java.util.Set;
11
12
 
12
13
  import org.embulk.config.ConfigException;
@@ -386,4 +387,9 @@ public class JdbcInputConnection
386
387
  return columnNamesBuilder.build();
387
388
  }
388
389
  }
390
+
391
+ public void showDriverVersion() throws SQLException {
392
+ DatabaseMetaData meta = connection.getMetaData();
393
+ logger.info(String.format(Locale.ENGLISH,"Using JDBC Driver %s",meta.getDriverVersion()));
394
+ }
389
395
  }
@@ -0,0 +1,37 @@
1
+ package org.embulk.input.jdbc;
2
+
3
+ import com.fasterxml.jackson.annotation.JsonCreator;
4
+ import com.fasterxml.jackson.annotation.JsonValue;
5
+
6
+ import org.embulk.config.ConfigException;
7
+
8
+ public enum Ssl
9
+ {
10
+ ENABLE,
11
+ DISABLE,
12
+ VERIFY;
13
+
14
+ @JsonValue
15
+ @Override
16
+ public String toString()
17
+ {
18
+ return this.name().toLowerCase();
19
+ }
20
+
21
+ @JsonCreator
22
+ public static Ssl fromString(String value)
23
+ {
24
+ switch(value) {
25
+ case "enable":
26
+ case "true":
27
+ return ENABLE;
28
+ case "disable":
29
+ case "false":
30
+ return DISABLE;
31
+ case "verify":
32
+ return VERIFY;
33
+ default:
34
+ throw new ConfigException(String.format("Unknown SSL value '%s'. Supported values are enable, true, disable, false or verify.", value));
35
+ }
36
+ }
37
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-jdbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-26 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Selects records from a table.
14
14
  email:
@@ -19,7 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - README.md
21
21
  - build.gradle
22
- - classpath/embulk-input-jdbc-0.8.3.jar
22
+ - classpath/embulk-input-jdbc-0.8.4.jar
23
23
  - lib/embulk/input/jdbc.rb
24
24
  - src/main/java/org/embulk/input/JdbcInputPlugin.java
25
25
  - src/main/java/org/embulk/input/jdbc/AbstractJdbcInputPlugin.java
@@ -28,6 +28,7 @@ files:
28
28
  - src/main/java/org/embulk/input/jdbc/JdbcInputConnection.java
29
29
  - src/main/java/org/embulk/input/jdbc/JdbcLiteral.java
30
30
  - src/main/java/org/embulk/input/jdbc/JdbcSchema.java
31
+ - src/main/java/org/embulk/input/jdbc/Ssl.java
31
32
  - src/main/java/org/embulk/input/jdbc/ToString.java
32
33
  - src/main/java/org/embulk/input/jdbc/ToStringMap.java
33
34
  - src/main/java/org/embulk/input/jdbc/getter/AbstractColumnGetter.java