数据库期末大作业|基于Java的数据库管理系统(个人财务数据库管理系统)

添加jar包的方法

  1. 右键工程 --> Build Path --> Configure Build Path
  2. 进入界面后,Libraries --> Class Path --> Add External JARs…
  3. 选择要导入的jar包 --> Apply and Close

错误1

无法创建驱动程式实体!java.sql.SQLException: No suitable driver found for jdbc:sqlserver://localhost:1433; DatabaseName=MyMoney
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:702)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at mymoney.Login.initializeDB(Login.java:125)
at mymoney.Login.(Login.java:39)
at mymoney.Login$6.run(Login.java:293)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue 4. r u n ( E v e n t Q u e u e . j a v a : 715 ) a t j a v a . b a s e / j a v a . s e c u r i t y . A c c e s s C o n t r o l l e r . d o P r i v i l e g e d ( A c c e s s C o n t r o l l e r . j a v a : 391 ) a t j a v a . b a s e / j a v a . s e c u r i t y . P r o t e c t i o n D o m a i n 4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.base/java.security.ProtectionDomain 4.run(EventQueue.java:715)atjava.base/java.security.AccessController.doPrivileged(AccessController.java:391)atjava.base/java.security.ProtectionDomainJavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

解决方案

导入 sqljdbc4-chs-4.0.2206.100.jar包 (驱动sql包)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值