不能从 Connection 转换为 Connection
import java.beans.Statement;
import com.sun.corba.se.pept.transport.Connection;
import java.sql.*;
public class aa{
public static void main(String[] args){
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
try {
Connection con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/guestbook", "root","123");
} catch (SQLException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
try {
// Statement st = con.
// ResultSet rs = st.
// //ResultSet rs = stmt.execute("select * from messges");
} catch (SQLException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
}
}
Connection con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/guestbook", "root","123");
这句提示类型不匹配:不能从 Connection 转换为 Connection 怎么回事的?
还有,实例化了Statement 到st上.它却找不到executeQuery()这个方法...
...全文
相关推荐
mysql blob to 向 file转换
mysql数据库 中用blob存储image及file 数据blob的写入与提取 方法概要
解决C#上传Excel文本数字混合不能识别的情况
解决C#上传Excel文本数字混合不能识别的情况
Pro_E与ANSYS若干模型数据的转换方式
Pro_E与ANSYS若干模型数据的转换方式 Pro_E与ANSYS若干模型数据的转换方式
ASP常用语句
ASP常用语句,包括:数据库操作、判断比较功能等,适合网页制作初学者参考。文中内容系本人从网上收集整理。
Windows Server 2000无路由器的共享设置.pdf
Windows Server 2000无路由器的共享设置.pdf


Java SE
