English 中文(简体)
Netbeans IDE没有司机
原标题:Driver not found in Netbeans IDE

I have read all possible answer here and here and here. I believe I have a problem somewhere else and it may useful to others also.

I have a Java Servlet and it was executing well in eclipse IDE but later I shifted the project to Netbeans. I imported MySQL JDBC driver in Libraries and using the code below for connection

connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/bolsms", "root", "@#$5869@#$");

但是,我正看到这一错误。 没有发现任何适当的司机,以打碎布:mysql:// localhost:3306/bols

我寻求两天的回答,社区将赞赏我不再重复这个问题。

<><><>>>>>

最佳回答

当你在Tomcat使用时,你必须明确装上jdbc司机。 我在Tomcat的一个服务器上也遇到同样的错误。 添加<条码>Class.forName("com.mysql.jdbc. 司机”;解决。

The other thing I think, is to put the jar file in your WEB-INF/lib, then in your project properties, in Libraries, add the JAR you store in WEB-INF/lib.

To create the lib directory, right click on WEB-INF and choose New -> Folder... If you don t see Folder choose Other then in the new windows choose Other again and Folder.

Tomcat /JDBC 问题参考了

问题回答

在您的法典中列入以下法典:

Class.forName("com.mysql.jdbc.Driver");//load driver
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/bolsms", "root", "@#$5869@#$");//connect to the database

you could also import it using the jsp tag <%@page import= com.mysql.jdbc.* %> or the usual way Class.forName("com.mysql.jdbc.Driver").newInstance(); in the try catch of the jsp page. Good luck

检查,确保您的我sql-linkor-java-(转化)-bin。 页: 1

C:MurachServlets and JSPjsp2_allfilesservlet_jsp etbeansex_startsch14sqlGatewayuildwebWEB-INFlib

并检查是否在此:

C:MurachServlets and JSPjsp2_allfilesservlet_jsp etbeansex_startsch14sqlGatewaywebWEB-INFlib

否则,就会把你的我的q子司机jar入这些名录,看看看看这是否奏效。

之后,确保你重新明确装载司机:

班级:





相关问题
Netbeans CVS - existing repo - existing working copy

I m using Netbeans to develop with Drupal. I m trying to let Netbeans get drupal core and modules from the repository on drupal.org to my local working copy. Problem is: I already have a working ...

Java Library and Class Path Problems

Quick personal background: I was hired a few months ago as the sole .NET developer (C#) by a company whose other devs are all php devs. A week into the job I was told they wanted to switch to Java ...

Privileged operations in netbeans mobility

I m writing a Java ME app that will use privileged operations such as messaging. By default the user is prompted to confirm each of these operations, but I would like to run it as a background ...

Running unit tests on both windows and linux

Is there a way, a method, to be able to effectively run unit tests (phpunit) on both linux and windows? I need to do this because some parts of the system is only available under linux, but i do want ...

Dependency bundle (jar-files/sources/API docs) in Eclipse

I m developing various in-house extensions for JIRA, the issue tracker we use. So far I worked with Netbeans and everything worked like a charm. However, now I need to switch to Eclipse and I m ...

热门标签