- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这非常令人沮丧,尤其是因为据我所知,我已经浏览了整个论坛并遵循了所有指示。
我正在尝试创建到本地 mysql 数据库的连接。首先我从http://dev.mysql.com/downloads/connector/j下载了mysql驱动。使用独立于平台的 TAR(我在 ubuntu 上)。然后我将生成的 JAR 放入我为我的项目调用/lib 创建的新文件夹中,然后右键单击并选择“添加到构建路径”。它现在显示为引用库。
对于代码,我正在做您会做的典型事情:
try {
Class.forName("com.mysql.jdbc.Driver");
String db_url = "jdbc:mysql://localhost/project";
connect = DriverManager.getConnection(db_url, "user", "password");
statement = connect.createStatement();
resultSet = statement.executeQuery("select * from database.table");
while (resultSet.next()) {
int id = resultSet.getInt("ID");
String name = resultSet.getString("Name");
System.out.println("(ID: " + id + ") (Name: " + name + ")");
}
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
但无论出于何种原因,我仍然得到“java.lang.ClassNotFoundException: com.mysql.jdbc.Driver cannot be found”
我确定这对我来说完全是愚蠢的,但是关于我遗漏了什么的任何指示?
这是堆栈跟踪:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver cannot be found by com.personal.recipes_1.0.0.qualifier
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.personal.recipes.test.TestUtils.execute(TestUtils.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:243)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:224)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:167)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:850)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:743)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$7(HandledContributionItem.java:727)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:662)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:162)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
最佳答案
所以我之前可能没有很好地解释我的问题。这个问题特别与让我的 Eclipse RCP 应用程序查看驱动程序有关。与一位 friend 交谈后,他提醒我需要将 mysql jar 直接添加到 .MF 文件中。一旦我知道我在各种论坛上找到了大量帖子来回答我的问题。
我添加了以下行,并且能够毫无问题地连接到数据库:
“Bundle-ClassPath: lib/mysql-connector-java-5.1.30-bin.jar, .”
末尾的 (.) 也很重要,让我困扰了几分钟。
关于java - Eclipse IDE 无法识别 mysql 驱动程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22903589/
我正在寻找一个编辑器/IDE,它可以为不是专门为它构建的语言提供在编码时很好的功能(例如:能够点击到函数定义)。通过这些,我想到了为非常特定的目的而设计的语言,并且通常只被一个小社区使用。换句话说,那
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
有简单的解释性编程语言,实际上还有控制台 interpreter.exe。 需要按 F5 对语法进行着色、自动完成和执行。 (如果有可能进行“调试”——那就太棒了!) 我从来没有做过这样的事情。 有许
我只是想知道是否有任何可以在我的黑莓上运行的 IDE。我的旧 Palm 有 C 和 BASIC 翻译。 C 板上使用 Palm 的内置文本编辑器,但 BASIC 解释器内置了自己的简单编辑器。 黑莓或
我正在制作一个文件编辑器,并希望为我的用户提供一个不错的 IDE,可以在其中在浏览器上编辑他们的 html/css 文件。是否有任何编辑器与 TinyMCE 类似,但它不是一个所见即所得的编辑器,它更
是否有一个带有集成调试器的D IDE? 最佳答案 Descent可以使用调试器。不完全是您的要求,但是... 关于ide - 是否有一个带有集成调试器的D IDE?,我们在Stack Overflow
每个程序员都知道工具很重要,对于开发人员来说,没有比用于编码的 IDE 更重要的工具了。在过去的几年里,IDE-s 成为标准,在这个领域看到创新并不常见。您可以推荐哪些 IDE 具有创新性,它们引入了
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想改善这个问题吗?更新问题,以便将其作为on-topic
我目前正在学习Ironpython和热爱软件,但我希望从使用notepad ++和cmd.exe继续前进,并尝试使用果汁多一点的东西。 我最近了解到Iron python studio不支持Iron
我主要从事 Java 和 C/C++ 开发,但我开始做更多的 Web 开发(PHP、Rails)和 Eiffel(学习一门新语言总是好的)。 目前,我使用 Eclipse for Java、C/C++
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
是否有 280Atlas (280atlas.com)(免费/商业)的替代品? 其中哪些是成熟的? 最佳答案 您可以使用 nib2cib ,这几乎是相同的想法,但它使用界面构建器(xcode的一部分)
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
IDE 的目标是提高生产力。他们在这方面做得很好。重构、导航、内联文档、自动完成有助于极大地提高生产力。 但是:每个工具都是武器 .相同的 IDE 有助于生成块代码。一些 IDE 功能会导致产生不良代
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
我正在寻找一些功能强大的C / C ++编程环境。实际上,我唯一需要的就是强大的源导航+创建工具。免费或商业都无所谓。我更喜欢一些linux工具,但是它不一定是必需的linux应用。 我需要的是一种具
我刚开始学习 D。有人知 Prop 有自动格式化功能的 D IDE 吗? Eclipse 的 DDT 似乎除了语法高亮之外没有任何其他功能。 最佳答案 我相信,目前 MonoDevelop + Mon
我有兴趣为一个副项目构建一个新风格的 IDE。主要是为了取消类固醇IDE上的普通记事本。我正在为已经尝试过的或者你已经看到(或没有看到)看起来很酷并且在 IDE 中有用的东西寻找一些灵感。我可以解决的
我需要维护一些 VB6 应用程序,并且在涉及枚举名称时遇到了一个奇怪的问题。 VB6 中的 Intellisense 应该工作的方式是,如果我的变量名称被定义为,例如,Dim Abraxis as S
正如标题所说,我看到很多编辑将宏录制作为一项功能吹捧,但自己却找不到利用这些功能的方法。那你能用它做什么呢?您可以记录鼠标移动和/或击键的类型?对外面的人真的那么有帮助吗?具体来说,我处理的 Ecli
我是一名优秀的程序员,十分优秀!