该消息向我表明它无法连接到数据库。仔细检查您的连接字符串,并确保您的驱动程序在类路径中。我还认为您需要将“
jdbc”作为连接字符串的一部分,除非最近进行了更改。
<property name="hibernate.connection.url" value="jdbc:postgres://****:****@ec2-***-**-***-***.compute-1.amazonaws.com:6232/*****"/>
编辑:我只是盯着这个库的先前版本的来源,如果第214行与这两个版本相同,则您的连接肯定为空(即未发生)。
这是
DriverManagerConnectionProviderImpl我方便使用的版本的214行:(4.2.0.CR2)
214 if ( conn.getAutoCommit() != autocommit ) {215 conn.setAutoCommit(autocommit);216 }以下是前几行:
198 Connection conn;199 if ( driver != null ) {200 // If a Driver is available, completely circumvent201 // DriverManager#getConnection. It attempts to double check202 // ClassLoaders before using a Driver. This does not work well in203 // OSGi environments without wonky workarounds.204 conn = driver.connect( url, connectionProps );205 }206 else {207 // If no Driver, fall back on the original method.208 conn = DriverManager.getConnection( url, connectionProps );209 }210 211 if ( isolation != null ) {212 conn.setTransactionIsolation( isolation.intValue() );213 }214 if ( conn.getAutoCommit() != autocommit ) {215 conn.setAutoCommit(autocommit);216 }


