20165216第七周学习总结
教材学习简介
十一章
1 MySQL 数据库管理系统
注意:直接关闭MySQL数据库服务器所占用的命令行窗口不能关闭MySQL数据库服务器,可以使用任务管理器关闭数据库服务器。
2 root用户
MySQL授权的唯一用户,密码为空。访问数据库必须得到root用户的授权,root也可授权给其他用户。
2 JDBC Java中专门用于操作数据库的API,使用JDBBC的应用程序一旦和数据库建立连接,就可以用其API操作数据库.,形象图和作用用书上的就好了。
3连接数据库
MySQL与数据库的链接,第一步是和MySQL数据库服务器建立连接,常用的连接方式为加载JDBC-数据库驱动。
加载JDBC-MySQL数据库驱动
try{ Class.forName("com.mysql.jdbc.Driver");
}
catch(Exceptio e){}
4:通用查询
程序中结果集ResultSet对象rs调用getMetaData()方法返回一个ResultSetMetaData对象。
ResultSetMetaData metaData = rs.getMetaData();
调用getColumnCount()方法返回rs中列的数目。
代码托管