日期:2014-05-16 浏览次数:20346 次
Class.forName("com.mysql.jdbc.Driver");//设置驱动 Connection con = DriverManager.getConnection( "jdbc:mysql://10.0.0.207:3306/db_boss", "root", "123456");//获取连接 Statement state = con.createStatement();//创建Statement ResultSet result = state.executeQuery("select * from CHANNEL");//执行SQL while (result.next()) { System.out.print(result.getInt(1) + "--" + result.getString(5)// + "\n");//处理结果集 }