Type mismatch: cannot convert from java.sql.PreparedStatement to com.mysql.jdbc.PreparedStatement


Connection.prepareStatement()函数出错,提示:

Type mismatch: cannot convert from java.sql.PreparedStatement to com.mysql.jdbc.PreparedStatement

这是因为引入的包不对头,

import com.mysql.jdbc.PreparedStatement;
import com.mysql.jdbc.Statement;

引入正确的包就没有这个错误了。

import java.sql.PreparedStatement;
import java.sql.Statement;

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM