<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>感受 on 庞玉栋个人博客</title><link>https://pangyd.com/tags/%E6%84%9F%E5%8F%97/</link><description>Recent content in 感受 on 庞玉栋个人博客</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Wed, 09 Aug 2017 21:40:51 +0800</lastBuildDate><atom:link href="https://pangyd.com/tags/%E6%84%9F%E5%8F%97/index.xml" rel="self" type="application/rss+xml"/><item><title>基本上写完人事管理系统的感受</title><link>https://pangyd.com/post/46/</link><pubDate>Wed, 09 Aug 2017 21:01:53 +0800</pubDate><guid>https://pangyd.com/post/46/</guid><description>&lt;p>总共写了6天 &amp;nbsp;一个字累 但是坚持了下来 为了下个学期的Java web &amp;nbsp;&lt;/p>&lt;p>知识点总结：&lt;/p>&lt;p>Statement：用于执行静态sql语句 并返回它所生成的结果（定义成私有变量）&lt;/p>&lt;p>ResultSet ：结果集类&lt;/p>&lt;p>Connection：链接类&amp;nbsp;&lt;/p>&lt;p>"jdbc:mysql://localhost:3306/db_hrms"：数据库链接地址字符串 前面定义为字符型&lt;/p>&lt;p>characterEncoding=GBK:防止乱码&lt;/p>&lt;p>Class.forName("com.mysql.jdbc.Driver");：连接驱动字符串&lt;/p>&lt;p>{&lt;/p>&lt;p>&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; conn=(Connection) DriverManager.getConnection(strurl, username, password); ：conn用于连接数据库 分别为地址 用户名 密码&lt;/p>&lt;p>&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DriverManager.getConnection： 启动器管理类的连接方法&lt;/p>&lt;p>}try方法&lt;/p>&lt;p>commit():该方法用于修改传入的结果 放进数据库&lt;/p>&lt;p>insert into Person() values(）; insert：插入 &amp;nbsp;into: 进入中 Person() 表 &amp;nbsp;values 数据 ：字面意思&lt;/p>&lt;p>update Person set * 修改 person表中的 设置 后面跟 表中字符加修改字符&lt;/p>&lt;p>delete from Person where PersonID 删除&lt;/p></description></item></channel></rss>