No suitable driver found for jdbc:mysql://127.0.0.1:3306/test 什么错误?
<%@pageimport="java.sql.*"%><%@pagecontentType="text/html;charset=GBK"%><html><head><...
<%@ page import="java.sql.*" %>
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
</head>
<body>
<%
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
try{
//注册驱动
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
//连接
conn=DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/test","zhaojing","mimamima");
out.println("1");
//rs=stmt.executeQuery("select id from student");
//out.println(rs);
//if(rs.next())
// out.println(rs.getString("id"));
}
catch(ClassNotFoundException e){
out.println(e.getMessage());
}
finally{
}
%>
</body>
</html> 展开
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
</head>
<body>
<%
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
try{
//注册驱动
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
//连接
conn=DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/test","zhaojing","mimamima");
out.println("1");
//rs=stmt.executeQuery("select id from student");
//out.println(rs);
//if(rs.next())
// out.println(rs.getString("id"));
}
catch(ClassNotFoundException e){
out.println(e.getMessage());
}
finally{
}
%>
</body>
</html> 展开
3个回答
展开全部
就是你的数据库连接有问题呢 你是用IP那种方式连接的吗 那是你电脑的IP吗
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |