I'm making a simple JDBC program in java SE 7 but after compiling program it's giving "java.lang.ClassNotFoundException: org.postgreasql.Driver" error i followed this link http://docs.oracle.com/javase/7/docs/technotes/guides/jdbc/ but not getting yet so please help.
-
please provide your code here?Iren Patel– Iren Patel2013-10-04 11:07:52 +00:00Commented Oct 4, 2013 at 11:07
-
1You need to include the postgres JDBC driver in the classpath.Boris the Spider– Boris the Spider2013-10-04 11:08:59 +00:00Commented Oct 4, 2013 at 11:08
-
Iren: here is my source code.. pastebin.com/iiSsSDPZRajendra arora– Rajendra arora2013-10-04 11:11:13 +00:00Commented Oct 4, 2013 at 11:11
-
1perhaps because there is no postgreasql driver?Ingo– Ingo2013-10-04 11:11:34 +00:00Commented Oct 4, 2013 at 11:11
-
I believe its not a compile time error, but it occurs at runtime!Amir Pashazadeh– Amir Pashazadeh2013-10-04 11:13:23 +00:00Commented Oct 4, 2013 at 11:13
|
Show 2 more comments
6 Answers
possibly you may not be setting the path of jdbc driver follow the steps
- Right click on your project
- click buildpath->configure Build Path
- click libraries tab
- Click add external jars and give the path of driver
3 Comments
SpringLearner
@AnubhavSharma which IDE you are using?
sg28
@SpringLearner You are the man ,it worked ,thank you
SpringLearner
@sg28 you are welcome
You would have to add the JAR file to your classpath for org.postgresql.Driver, You can download it from HERE .
2 Comments
Rajendra arora
i downloaded now how to set?
You have to add the jdbc jar file on your build path. Firstly you have to download the jar from the link you provided. Then add it to build path. If you use eclipse: Right click on your project at the package explorer->Configure Build Path->Libraries->Add external jar->select your jar.
1 Comment
istovatis
The path is the location of your jar file. If you download it usually goes to Downloads folder or the file you chose to download files with browser.