首页 > 代码库 > 解决Only a type can be imported. com.mysql.jdbc.Connection resolves to a package的报错问题

解决Only a type can be imported. com.mysql.jdbc.Connection resolves to a package的报错问题

写jsp加载数据驱动以后老是提示Only a type can be imported. com.mysql.jdbc.Connection resolves to a package的错误,然而改成java就无报错

出错的原因:没有成功引入包

解决方法:将mysql-connector-java-5.1.39-bin.jar放到tomcat的bin目录下就可以解决

 

解决Only a type can be imported. com.mysql.jdbc.Connection resolves to a package的报错问题