您好:书名:学通java的24堂课 本书的22.24.4节 执行时出现了Unknown database 'db_jxc'错误,书上说是数据库公共类中db_jxc数据库名称不对,但我看了数据库名称db_jxc是对的,不知道是什么问题?第二个问题:MainFrame.java文件一直提示错误。辛苦老师帮忙解决,感谢。
根号申 发表于2019-04-02 14:11
你自己编写一个JDBC测试代码,看是否能链接上这个数据库表。输出一下Connection对象看是不是null,null就是连不上。
不要只给红叉截图,红叉只能说明这个类有错误,具体是什么错误看eclipse的错图提示。
Exception in thread "AWT-EventQueue-0" java.lang.Error: 无法解析的编译问题:
at zzk.zhuoyue.daohang.MainDaohangFrame.launch(MainFrame.java:1283)
at zzk.zhuoyue.daohang.LoginFrame$PanelBack.btn_enterActionPerformed(LoginFrame.java:256)
at zzk.zhuoyue.daohang.LoginFrame$PanelBack.pwd_passwordActionPerformed(LoginFrame.java:293)
at zzk.zhuoyue.daohang.LoginFrame$PanelBack.access$1(LoginFrame.java:292)
at zzk.zhuoyue.daohang.LoginFrame$PanelBack$2.actionPerformed(LoginFrame.java:193)
at javax.swing.JTextField.fireActionPerformed(JTextField.java:492)
at javax.swing.JTextField.postActionEvent(JTextField.java:705)
at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:820)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2849)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2884)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2812)
at java.awt.Component.processEvent(Component.java:5993)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:704)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:969)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:841)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:668)
at java.awt.Component.dispatchEventImpl(Component.java:4455)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "AWT-EventQueue-0" java.lang.Error: 无法解析的编译问题:
zhouyouSQ 发表于2019-04-02 16:14
Exception in thread "AWT-EventQueue-0" java.lang.Error: 无法解析的编译问题:
at zzk.zhuoyue.daohang.MainDaohangFrame.launch(MainFrame.java:1283)
at zzk.zhuoyue.daohang.LoginFrame$PanelBack.btn_enterActionPerformed(LoginFrame.java:256)
at zzk.zhuoyue.daohang.LoginFrame$PanelBack.pwd_passwordActionPerformed(LoginFrame.java:293)
at zzk.zhuoyue.daohang.LoginFrame$PanelBack.access$1(LoginFrame.java:292)
at zzk.zhuoyue.daohang.LoginFrame$PanelBack$2.actionPerformed(LoginFrame.java:193)
at javax.swing.JTextField.fireActionPerformed(JTextField.java:492)
at javax.swing.JTextField.postActionEvent(JTextField.java:705)
at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:820)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2849)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2884)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2812)
at java.awt.Component.processEvent(Component.java:5993)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:704)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:969)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:841)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:668)
at java.awt.Component.dispatchEventImpl(Component.java:4455)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "AWT-EventQueue-0" java.lang.Error: 无法解析的编译问题:
现在不报任何错误,但是在Eclipse控制台中一直返回这些错误消息。