getting error: Could not load JDBC driver class [org.postgresql.Driver]

前端 未结 2 1511
别那么骄傲
别那么骄傲 2020-12-11 01:52

I\'m trying run a Junit test,have configured before only projects without maven, now i am trying to make this integration, but i stop in this following error:



        
相关标签:
2条回答
  • 2020-12-11 02:10

    You can do a simple test in your project to make sure class "org.postgresql.Driver" is on your classpath

    try {
      Class.forName("org.postgresql.Driver");
      //on classpath
    } catch(ClassNotFoundException e) {
      // not on classpath
    }
    
    0 讨论(0)
  • 2020-12-11 02:13

    did you add the postgres dependency in your pom.xml ??

    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.3-1100-jdbc41</version>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题