DataStream jdbc sink

Posted by Traku traku on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/DataStream-jdbc-sink-tp4270.html

Hi everyone.

I'm trying to migrate some code to flink 0.10 and I'm having a problem.

I try to create a custom sink to insert the data to a postgresql database. My code was this.

var.output(
        // build and configure OutputFormat
        JDBCOutputFormat
                .buildJDBCOutputFormat()
                .setDrivername("org.postgresql.Driver")
                .setDBUrl("jdbc:postgresql://127.0.0.1:5432/test")
                .setUsername("postgres")
                .setPassword("")
                .setQuery("insert into XXX  values  (?,?,?);") 
                .finish()
        );

Could you help me?

Best regards.