0
votes

I am trying to run apache-nifi one server and postgresql in a remote server.

When I try to insert records to remote database, I get following error.

java.sql.SQLException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:postgresql//123.456.789.12:5432/test?stringtype=unspecified'

Here I use stringtype=unspecified as it was the solution for : Column is of type timestamp without time zone but expression is of type character varying : Nifi

In my PutDatabaseRecord processor.

Database Connection URL : jdbc:postgresql//123.456.789.12:5432/test?stringtype=unspecified

Database Driver Class Name : org.postgresql.Driver

Database Driver Location(s) : /opt/postgresql-42.2.8.jre6.jar

jar file is placed on both servers at same location. What am I missing? should nifi and database run in a same server?

Edit : nifi-log

2019-10-29 07:35:23,062 ERROR [Timer-Driven Process Thread-8] o.a.n.p.standard.PutDatabaseRecord PutDatabaseRecord[id=f1fcb902-a1a2-364e-8223-971e4d0dfa46] Failed to process session due to org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:postgresql//123.456.789.12:5432/test?stringtype=unspecified': org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:postgresql//123.456.789.12:5432/test?stringtype=unspecified' org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:postgresql//123.456.789.12:5432/test?stringtype=unspecified'

1
show full stacktrace from the nifi log file. there should be details of this error.daggett

1 Answers

1
votes

Please add : in your database connection URL and check

jdbc:postgresql://123.456.789.12:5432/test?stringtype=unspecified