com.mysql cannot be resolved to a type 错误

zr_dixuexiongying 2012-09-09 12:59:46
在测试mysql的时候报错,我用的是mysql5.0.22,用的驱动包是5.0.8的,在测试的时候报错

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.DriverManager;

public class Test{
public static void main(String[] args){

}

static void test() throws Exception{
//注册驱动
DriverManager.registerDriver(new com.mysql.jdbc.Driver());
}
}

在com.mysql下总是有红线,报错
com.mysql.cannot be resolved to a type

Multiple markers at this line
- com.mysql cannot be resolved to a type
- Occurrence of "mysql"

注:mysql-connector-java-5.0.8.zip 包已经导入
...全文
499 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
發糞塗牆 2012-09-09
  • 打赏
  • 举报
回复

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧