{"id":5468,"date":"2014-03-30T22:24:27","date_gmt":"2014-03-30T22:24:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/keeps-getting-class-not-found-exception-for-postgres-driver-in-eclipse-plugin-collection-of-common-programming-errors\/"},"modified":"2014-03-30T22:24:27","modified_gmt":"2014-03-30T22:24:27","slug":"keeps-getting-class-not-found-exception-for-postgres-driver-in-eclipse-plugin-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/keeps-getting-class-not-found-exception-for-postgres-driver-in-eclipse-plugin-collection-of-common-programming-errors\/","title":{"rendered":"Keeps getting Class Not Found Exception for Postgres driver in eclipse plugin-Collection of common programming errors"},"content":{"rendered":"<p>I am developing a simple plugin for eclipse, which has one view connecting to Postgres. I have installed postgres which is running fine. I have a driver: postgresql-9.0-801.jdbc4.jar which was provided with the installation package.<\/p>\n<p>Now I&#8217;m trying to connect to database using the code:<\/p>\n<pre><code>try {\n    Class.forName(\"org.postgresql.Driver\");\n} catch (ClassNotFoundException cnfe) {\n    cnfe.printStackTrace();\n    return false;\n}\n<\/code><\/pre>\n<p>Of course, I&#8217;ve added mentioned JAR to class path: right click on project &gt; preferences &gt; Java Build Path It is added to &#8220;Libraries&#8221;.<\/p>\n<p>Still I get an error:<\/p>\n<pre><code>java.lang.ClassNotFoundException: org.postgresql.Driver\n<\/code><\/pre>\n<p>I have also checked the box in &#8220;Order and Export&#8221; tab.<\/p>\n<p>What am I doing wrong?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am developing a simple plugin for eclipse, which has one view connecting to Postgres. I have installed postgres which is running fine. I have a driver: postgresql-9.0-801.jdbc4.jar which was provided with the installation package. Now I&#8217;m trying to connect to database using the code: try { Class.forName(&#8220;org.postgresql.Driver&#8221;); } catch (ClassNotFoundException cnfe) { cnfe.printStackTrace(); return [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5468","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5468"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5468\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}