结对同伴:
学号:201406114249
姓名:陈焕恳
博客地址:http://www.cnblogs.com/4249ken/p/5361072.html
项目完成估计与实际完成对比表如下所示:
估计查找资料时间(h) | 2 |
时间查找资料时间(h) | 3 |
估计团队讨论时间(h) | 2 |
时间团队讨论时间(h) | 4 |
估计编程时间(h) | 3 |
实际编程时间(h) | 4 |
估计完成时间(h) | 7 |
实际完成时间(h) | 11 |
分工:
曾治业:主要负责编写代码;
陈焕恳: 负责查阅相关资料和协同其检查代码: http://www.2cto.com/kf/201405/298386.html
http://www.2cto.com/kf/201405/298386.html
http://blog.sina.com.cn/s/blog_78391af201018mnk.html
http://www.cnblogs.com/zhwl/archive/2012/08/28/2659832.html
http://blog.csdn.net/iamduoluo/article/details/7484329
github地址:https://github.com/zzy999/fulijisuan/tree/master/ComInt
主要代码:
把数据输入到mysql中:
1 public class testJ { 2 public static void server(double P, double i, int N, int m, double F) 3 throws SQLException, ClassNotFoundException { 4 String name = "root"; 5 String pwd = "zzy999"; 6 String url = "jdbc:mysql://localhost:3306/compound"; 7 8 Class.forName("com.mysql.jdbc.Driver"); 9 // Class.forName("org.gjt.mm.mysql.Driver"); 10 Connection conn = DriverManager.getConnection(url, name, pwd); 11 Statement stmt = conn.createStatement(); 12 String sql1 = "insert into calculation(P,i,N,m,F) values (?,?,?,?,?)"; 13 PreparedStatement pstmt = conn.prepareStatement(sql1); 14 pstmt.setDouble(1, P); 15 pstmt.setDouble(2, i); 16 pstmt.setInt(3, N); 17 pstmt.setInt(4, m); 18 pstmt.setDouble(5, F); 19 pstmt.executeUpdate(); 20 stmt.close(); 21 conn.close(); 22 } 23 24 }
从数据库中输出数据:
1 public class test1_1 { 2 public static void server(double P, double i, int N, int m, double F) 3 throws SQLException, ClassNotFoundException { 4 String name = "root"; 5 String pwd = "zzy999"; 6 String url = "jdbc:mysql://localhost:3306/compound"; 7 8 Class.forName("com.mysql.jdbc.Driver"); 9 // Class.forName("org.gjt.mm.mysql.Driver"); 10 11 Connection conn = DriverManager.getConnection(url, name, pwd); 12 Statement stmt = conn.createStatement(); 13 String sql = "select * from calculation"; 14 ResultSet rs = stmt.executeQuery(sql); 15 while (rs.next()) { 16 P = rs.getDouble("P"); 17 i = rs.getDouble("i"); 18 N = rs.getInt("N"); 19 m = rs.getInt("m"); 20 F = rs.getDouble("F"); 21 System.out.println(P + " " + i + " " + N + " " + m + " " + F); 22 } 23 rs.close(); 24 stmt.close(); 25 conn.close(); 26 } 27 28 }
实验结果:
团队工作照片:
实验总结:
这次实验考验的是我们之间团队合作的默契,分工要明确,要落实到每个人身上。在实验的过程中,与队友之间的交流很重要,要善于听取队友的意见,不是自己说怎样就怎样,往往队友看到的都是自己在细节上的失误,所以,在这里,我要好好感谢我的队友,衷心的说一声:“你辛苦了!”。
这次实验的最大困难是该怎样去连接数据库,由于以前没有学过相关的内容,所以大部分时间都花在了寻找资源上,因此,队友还是很辛苦的,给队友100个赞!虽然在实验的过程中经历了许多的失败,有气馁,有怨气,但是有队友的支持,我们最终还是成功的连接好了mysql。