使用SQL查询(使用Hibernate和Postgresql)通过Web应用程序(服务器)将记录插入数据库时,
This is my Hibernate Configuration File
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/openbravo</property>
<property name="hibernate.connection.username">postgres</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hbm2ddl.auto">update</property>
<property name="show_sql">false</property>
</session-factory>
</hibernate-configuration>
” 这是我得到的错误,如下所示:
DEBUG 2019-06-162 17:50 [http-nio-8080-exec-8] SessionImpl [] -220-在时间戳记中打开的会话:15602574493 DEBUG 2019-06-162 17:50 [http-nio-8080-exec-8] ConnectionManager [openConnection] -419-打开JDBC连接DEBUG 2019-06-162 17:50 [http-nio-8080-exec-8] DriverManagerConnectionProvider [getConnection] -109-打开新的JDBC连接DEBUG 2019-06-162 17:50 [http-nio-8080-exec-8] JDBCExceptionReporter [logExceptions] -69 -无法打开连接[???] org.postgresql.util.PSQLException:致命:抱歉,已经有太多客户端 在org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:291) 在org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108) 在org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66) 在org.postgresql.jdbc2.AbstractJdbc2Connection。(AbstractJdbc2Connection.java:125) 在org.postgresql.jdbc3.AbstractJdbc3Connection。(AbstractJdbc3Connection.java:30) 在org.postgresql.jdbc3.Jdbc3Connection。(Jdbc3Connection.java:24) 在org.postgresql.Driver.makeConnection(Driver.java:393) 在org.postgresql.Driver.connect(Driver.java:267) 在java.sql.DriverManager.getConnection(DriverManager.java:664) 在java.sql.DriverManager.getConnection(DriverManager.java:208) 在org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110) 在org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:421) 在org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144) 在org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:50) 在com.sun.proxy。$ Proxy21.createStatement(未知来源) 在org.astute.aits.hodportal.AllocateFacultyCoursesUtills.getSemesterSectionCourses(AllocateFacultyCoursesUtills.java:346) 在org.astute.aits.hodportal.AllocateFacultyCoursesServlet.doGet(AllocateFacultyCoursesServlet.java:45) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:635) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:742) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 在org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) 在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) 在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) 在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) 在org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660) 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) 在org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798) 在org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) 在org.apache.coyote.AbstractProtocol $ ConnectionHandler.process(AbstractProtocol.java:806) 在org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1498) 在org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624) 在org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61) 在java.lang.Thread.run(Thread.java:748)警告2019-06-162 17:50 [http-nio-8080-exec-8] JDBCExceptionReporter [logExceptions] -77 -SQL错误:0,SQLState:53300错误2019-06-162 17:50 [http-nio-8080-exec-8] JDBCExceptionReporter [logExceptions] -78- 致命:抱歉,已经有太多客户发生异常 org.hibernate.exception.GenericJDBCException:无法打开连接
在org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:351)“