java.sql.SQLException:No suitable driver found for http://localhost:3306/school
2015-02-11 21:24
831 查看
1、错误描述
java.sql.SQLException:No suitable driver found for http://localhost:3306/school
2、错误原因
由于连接数据库的URL写的有问题
3、解决办法
将上述“conn = DriverManager.getConnection("http://localhost:3306/school", "root", "root");”改写成“conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/school", "root", "root");”
java.sql.SQLException:No suitable driver found for http://localhost:3306/school
2、错误原因
Class.forName("com.mysql.jdbc.Driver"); Connection conn = null; Statement stat = null; ResultSet rs = null; try { conn = DriverManager.getConnection("http://localhost:3306/school", "root", "root"); stat = conn.createStatement(); stat.execute(""); } catch (SQLException e) { e.printStackTrace(); }
由于连接数据库的URL写的有问题
3、解决办法
将上述“conn = DriverManager.getConnection("http://localhost:3306/school", "root", "root");”改写成“conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/school", "root", "root");”
相关文章推荐
- java.sql.SQLException:No suitable driver found for http://localhost:3306/school
- neo4j Caused by:java.sql.SQLException:No suitable driver found for jdbc:neo4j:http:/127.0.0.1:7474/
- android studio下解决 java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/
- Spark on Yarn:java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://localhost\\db_instance_name:1433;databaseName=db_name
- java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1521:ORCL
- java.sql.SQLException: No suitable driver found for jdbc:sqlserver://localhost:1433;databaseName
- 使用Maven和Mybatis开发时,遇到“java.sql.SQLException: No suitable driver found for http://maven.apache.org”
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306
- 调试经验-java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1521:orcl
- java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://localhost:1433;
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/airline
- neo4j Caused by:java.sql.SQLException:No suitable driver found for jdbc:neo4j:http:/127.0.0.1:7474/
- mondrian java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/foodmart
- java.sql.SQLException: No suitable driver found for jdbc:mysql:/localhost/XXX?还是没有解决
- Tomcat 部署 时 java.sql.SQLException: No suitable driver found for jdbc:sqlserver 我是怎么解决的
- 发现造成java.sql.SQLException: No suitable driver found for proxool.test的原因
- CDH安装SQOOP错误:Caused by: java.sql.SQLException: No suitable driver found for jdbc:derby:/var/lib/sqoo
- java.sql.SQLException: No suitable driver found for jdbc:mysql
- 数据库连接时一个异常的处理:java.sql.SQLException: No suitable driver found for