NutzCN Logo
问答 nutzboot postgres初始化问题
发布于 2175天前 作者 baocj 1685 次浏览 复制 上一个帖子 下一个帖子
标签:

[2019-01-08 19:50:32.858] ERROR [Druid-ConnectionPool-Create-31803305] --- DruidDataSource: create connection SQLException, url: jdbc:postgresql://192.168.1.196:5432/ami, errorCode 0, state 0A000
java.sql.SQLFeatureNotSupportedException: 这个 org.postgresql.jdbc4.Jdbc4Statement.setQueryTimeout(int) 方法尚未被实作。
at org.postgresql.Driver.notImplemented(Driver.java:753)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setQueryTimeout(AbstractJdbc2Statement.java:668)
at com.alibaba.druid.pool.vendor.PGValidConnectionChecker.isValidConnection(PGValidConnectionChecker.java:64)
at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1358)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1646)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2505)

[2019-01-08 19:50:32.858] ERROR [Druid-ConnectionPool-Create-31803305] --- DruidDataSource: create connection SQLException, url: jdbc:postgresql://192.168.1.196:5432/ami, errorCode 0, state 0A000
java.sql.SQLFeatureNotSupportedException: 这个 org.postgresql.jdbc4.Jdbc4Statement.setQueryTimeout(int) 方法尚未被实作。
	at org.postgresql.Driver.notImplemented(Driver.java:753)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.setQueryTimeout(AbstractJdbc2Statement.java:668)
	at com.alibaba.druid.pool.vendor.PGValidConnectionChecker.isValidConnection(PGValidConnectionChecker.java:64)
	at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1358)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1646)
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2505)

server.port=8080
server.host=0.0.0.0

#jdbc.url=jdbc:h2:mem:~
jdbc.url=jdbc:postgresql://192.168.1.196:5432/ami
jdbc.username=postgres
jdbc.password=postgres

nutz.dao.interceptor.time.enable=true
nutz.dao.interceptor.cache.enable=true
2 回复
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.nutz</groupId>
		<artifactId>nutzboot-demo-simple</artifactId>
		<version>2.3-SNAPSHOT</version>
	</parent>
	<artifactId>nutzboot-demo-simple-dao</artifactId>
	<properties>
		<docker.image.prefix>nutzboot</docker.image.prefix>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-nutz-mvc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-nutz-dao</artifactId>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-jetty</artifactId>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-swagger</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>1.4.196</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/postgresql/postgresql -->
		<dependency>
			<groupId>postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<version>9.1-901-1.jdbc4</version>
		</dependency>

	</dependencies>
</project>

驱动版本低了

添加回复
请先登陆
回到顶部