The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1038)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:339)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2247)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2280)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2079)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216)
at com.mr.contact.hibernate.HibernateInitialize.<clinit>(HibernateInitialize.java:20)
at com.mr.contact.dao.DAOimpl.selectUsableCustomer(DAOimpl.java:236)
at frame.MainFrame.getUsableModleSoure(MainFrame.java:57)
at frame.MainFrame.initTable(MainFrame.java:47)
at frame.MainFrame.init(MainFrame.java:40)
at com.mr.contact.swing.ContactFrame.<init>(ContactFrame.java:50)
at frame.MainFrame.<init>(MainFrame.java:26)
at frame.MainFrame.main(MainFrame.java:93)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:214)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:298)
... 26 more
五月 27, 2020 9:20:58 上午 org.hibernate.dialect.Dialect <init>
信息: Using dialect: org.hibernate.dialect.MySQLDialect
五月 27, 2020 9:20:58 上午 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
信息: Using default transaction strategy (direct JDBC transactions)
五月 27, 2020 9:20:58 上午 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
信息: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Automatic flush during beforeCompletion(): disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Automatic session close at end of transaction: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Scrollable result sets: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: JDBC3 getGeneratedKeys(): disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Connection release mode: auto
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Maximum outer join fetch depth: 2
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Default batch fetch size: 1
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Generate SQL with comments: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Order SQL updates by primary key: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
信息: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
五月 27, 2020 9:20:58 上午 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
信息: Using ASTQueryTranslatorFactory
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Query language substitutions: {}
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: JPA-QL strict compliance: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Second-level cache: enabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Query cache: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory createCacheProvider
信息: Cache provider: org.hibernate.cache.NoCacheProvider
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Optimize cache for minimal puts: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Structured second-level cache entries: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Statistics: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Deleted entity synthetic identifier rollback: disabled
五月 27, 2020 9:20:58 上午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Default entity-mode: pojo
五月 27, 2020 9:20:58 上午 org.hibernate.impl.SessionFactoryImpl <init>
信息: building session factory
五月 27, 2020 9:20:58 上午 org.hibernate.impl.SessionFactoryObjectFactory addInstance
信息: Not binding factory to JNDI, no JNDI name configured
(以上是整个书本第二章,一直到101页,运行后报错,实在是找不到问题,数据库我后来是一段一段在命令提示窗口复制运行的,导入没有报错,后来运行还是不行)