I has a error :java.lang.ClassNotFoundException: org.postgresql.Driver

I designed a plug-in, in the code, I want to connect to the  postgresql  database , so calls the JDBC . I add the postgresql jdbc jar postgresql-9.2-1002.jdbc4.jar  in the  Plug-in dependencies and The SDK version of the plugin directory . 

    in source code , About the JDBC code as follows:

             Class.forName("org.postgresql.Driver"); // 加载postgresql驱动
            String strJdbc = String.format("jdbc:cloudsql://%s:%d/%s", "127.0.0.1", 5432, "xtest"); //          数据库连接串
            conn = DriverManager.getConnection(strJdbc, "stado", "stado"); // 建立一个jdbc连接
            Statement st=conn.createStatement();

            ..........

          but , when   I create a date stream, I run this plug ,   an  error has occurred:

           java.lang.ClassNotFoundException: org.postgresql.Driver

         why ? can you help me ?

Add: source without errors

          

I am very  sad .nobady  answer to my question .

now I alway Solved this problem.  

The cause of the error : the project can not find posrtgesql JDBC driver  when  running .

so I add jar in the path of Specify the plug-in class libraries .  the question is solved .

 

 

Cool, you found the error yourself.

Sorry you couldn't get an answer, but remind we are in a different time zone.

I  also encountered this problem. Can you tell me how to " add jar in the path of Specify the plug-in class libraries ", I think I add the jdbc.jar to the project, but it still showed the message "org.postgresql.Driver cannot be found", I try so many times, but it didn't work till now. Can someone help me supply the detail to use postgresql jdbc in Knime plugin development?  Thanks.

Can you help me? Thanks.

If you install the "KNIME Connectors for Common Databases" extension you will automatically get the PostgreSQL JDBC driver. You can simply add the extension to your target platform.