连接mysql的问题.. java.sql.SQLException: No suitable driver没有找到合适的Sql驱动啊。你确定java能找到sun.jdbc.odbc.JdbcOdbcDriver这个东西吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 驱动不同,你用了odbc和jdbc的连接桥一般用mysql的是这个驱动!Class.forName("org.gjt.mm.mysql.Driver").newInstance(); String url ="jdbc:mysql://localhost/testDB?user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1" //testDB为你的数据库名 Connection conn= DriverManager.getConnection(url); Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); String sql="select * from test"; ResultSet rs=stmt.executeQuery(sql); 改成这句就好了Class.forName("com.mysql.jdbc.Driver"); include小问题 有关文件下载的问题 求解答? swing 如何绘制水平Caret 在JAVA中有没有改变显示器分辨率的技术,请高手们指教,能不能给发点代码? 请教下integer问题 串口能写不能读,读取不完整,IO 表格制作 一个初学者,请大侠们给出这个题目的完整程序(急) Set接口、List、Map的差异 怎样解决JRun不支持中文的问题?? 请问这是什么错误Exception in thread "main" java.lang.NullPointerException java中的相对路径怎么写?
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String url ="jdbc:mysql://localhost/testDB?user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1"
//testDB为你的数据库名
Connection conn= DriverManager.getConnection(url);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select * from test";
ResultSet rs=stmt.executeQuery(sql);