已有101人关注
数据库导入问题:按照书本里的操作导入,发现有导入错误,以致后面还有其他错误(持续发帖)
发表在Java图书答疑 2020-05-27 悬赏:1 学分 《Java项目开发实战入门》第2章 通讯录系统 90页-92页
是否精华
版块置顶:


图片.png

分享到:
精彩评论 2
孤魅.HR_1562846622
学分:13 LV2
2020-05-27
沙发

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页,运行后报错,实在是找不到问题,数据库我后来是一段一段在命令提示窗口复制运行的,导入没有报错,后来运行还是不行)

根号申
学分:4736 LV12
TA的每日心情
2021-07-16 23:48:46
2020-05-27
板凳

https://www.bilibili.com/video/av53059111

看视频后半段检查数据库字符编码

首页上一页 1 下一页尾页 2 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照