You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by mi...@apache.org on 2020/06/08 10:33:52 UTC

[incubator-streampipes-extensions] 04/04: fixed wrong checkTable statement

This is an automated email from the ASF dual-hosted git repository.

micklich pushed a commit to branch feature/jdbc_rewrite
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes-extensions.git

commit 0142fbf31aeeb68817f7eca2c34e4c6ef6ed20cf
Author: micklich <fl...@disy.net>
AuthorDate: Mon Jun 8 12:33:33 2020 +0200

    fixed wrong checkTable statement
---
 .../sinks/databases/jvm/postgresql/PostgresJdbcClient.java            | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/postgresql/PostgresJdbcClient.java b/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/postgresql/PostgresJdbcClient.java
index 6bc0c96..fcbcbe7 100644
--- a/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/postgresql/PostgresJdbcClient.java
+++ b/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/postgresql/PostgresJdbcClient.java
@@ -126,7 +126,7 @@ public class PostgresJdbcClient extends JdbcClient {
       // Database should exist by now so we can establish a connection
       c = DriverManager.getConnection(url + databaseName, user, password);
       st = c.createStatement();
-      ResultSet rs = c.getMetaData().getTables(null, null, schemaName, null);
+      ResultSet rs = c.getMetaData().getTables(null, null, tableName, null);
       while (rs.next()) {
         // same table names can exists in different schmemas
         if (rs.getString("TABLE_SCHEM").toLowerCase().equals(schemaName.toLowerCase())) {
@@ -138,7 +138,7 @@ public class PostgresJdbcClient extends JdbcClient {
           createTable();
         }
       }
-      super.tableExists = true;
+      tableExists = true;
       rs.close();
     } catch (SQLException e) {
       closeAll();