某些方法在INTELLİJ Ide或Netbeans Ide中不起作用

问题描述 投票:0回答:1

我是开发人员领域的新手,我有疑问。例如 ;智商“连接连接;”“ Class.forName(” com.mysql.jdbc.Driver“);”“'connection = DriverManager.getConnection(” jdbc:mysql:/ localhost / vs .....)“方法可以正常工作,但是在netbeans中,ide'DriverManager'在我的电脑中看不到。您怎么看? ??

java netbeans
1个回答
0
投票

绝对同意艾略特。 DriverManager类可在任何IDE中使用,因为它是JDBC API的一部分,包含在任何JDK中。您最有可能收到一个带有消息“找不到合适的驱动程序”(或类似内容)的SQLException。这意味着,比您需要下载MySql Connector / J JAR文件并将其添加到Netbeans项目的类路径中。

© www.soinside.com 2019 - 2024. All rights reserved.