当前位置:Gxlcms > 数据库问题 > eclipse中使用maven调用postgreSQL

eclipse中使用maven调用postgreSQL

时间:2021-07-01 10:21:17 帮助过:64人阅读

使用Maven插件调用PostgreSQL数据库

环境:

eclipse_4.5.0+JDK_1.7+Tomcat_7.0+Maven+postgresql-9.1-901.jdbc4.jar

问题:

将maven工程在tomcat启动之后,出现错误字符串,主要错误信息如下:
Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class ‘org.postgresql.Driver‘
解决方案:
打开工作空间的pom.xml文件,在<dependencies>标签中添加或者修改 postgresql 数据驱动 为:
<!-- java postgresql 数据驱动-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.3-1100-jdbc41</version>
</dependency>

 

 

eclipse中使用maven调用postgreSQL

标签:sof   .com   .sql   exception   span   驱动   cannot   could not   load   

人气教程排行