找不到Jdbc驱动 [英] Jdbc Driver Not Found

查看:178
本文介绍了找不到Jdbc驱动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Java使用mysql数据库处理一些常见查询的netbeans中的一个项目。但是我在netbeans中为mysql加载jdbc驱动程序有问题。它提供以下错误:

We are working on a project in netbeans using Java which uses mysql database to process some common queries. But I am having issues with loading jdbc drivers for mysql in netbeans. It is giving following error:

找不到类异常:com.jdbc.mysql.Driver
请帮助我。

Class Not Found Exception : com.jdbc.mysql.Driver please help me out.

推荐答案

您只需将mysql JDBC连接器添加到您的项目中即可。对于Oracle数据库来说,这将是一样的(你必须添加ojdbc6.jar)。

You just have to add the mysql JDBC connector to your project. It would be the same for an Oracle database, for example (you would have to add the ojdbc6.jar).

所以关于MySQL你必须得到MySQL JDBC连接器并将其添加到您的类路径项目中。

So about MySQL you have to get the MySQL JDBC connector and add it to your classpath project.

  • get the MySQL JDBC connector, either on the MySQL site, either adding it through a Maven dependency (if your project is driven by Maven), check the official MySQL site. Current version in may 2012 is 5.1.19 (works with any version of MySQL) ;
  • add it to your Netbeans classpath, in the project properties. Check the online Netbeans configuration about project classpath if needed

这篇关于找不到Jdbc驱动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆