Knot Pair Companion Blog Park address:
: Guo Zhihao
http://home.cnblogs.com/u/gzh13692021053/
The project completion estimate and the actual completion comparison table are as follows:
Estimated time to find information (h) |
3 |
Time to find material time (h) |
4 |
Estimate team Discussion time (h) |
2 |
Time Team Discussion time (h) |
2 |
Estimated programming Time (h) |
5 |
Actual programming time (h) |
7 |
Estimated time to complete (h) |
9 |
Actual completion time (h) |
12
|
View related Information link: http://www.2cto.com/kf/201405/298386.html
GitHub Address: Https://github.com/Sub-key/1/tree/master/fulitest
Main code:
Enter the data into MySQL:
public void Dmysql (double p,int n,double r,int m,double F) throws ClassNotFoundException, sqlexception{
String name = "Root";
String pwd = "123456";
String url = "Jdbc:mysql://localhost_3306/fulisql";
try{
Class.forName ("Com.mysql.jdbc.Driver");
Class.forName ("Org.gjt.mm.mysql.Driver");
}catch (ClassNotFoundException e)
{
E.printstacktrace ();
}
Connection conn = drivermanager.getconnection ("Jdbc:mysql://localhost/fulisql", "root", "123456");
Statement stmt = Conn.createstatement ();
String SQL1 = "INSERT INTO Fuli (p,n,r,m,f) VALUES (?,?,?,?,?)";
PreparedStatement pstmt = conn.preparestatement (SQL1);
Pstmt.setdouble (1,P);
Pstmt.setint (2,n);
Pstmt.setdouble (3,R);
Pstmt.setint (4,M);
Pstmt.setdouble (5,F);
Pstmt.executeupdate ();
Pstmt.executeupdate ();
Stmt.close ();
Conn.close ();
}
}
Output data from the database:
public class Test1_1 {
public static void Server (double p,int N, double R, int M, double F)
Throws SQLException, ClassNotFoundException {
String name = "Root";
String pwd = "123456";
String url = "Jdbc:mysql://localhost:3306/fulisql";
Class.forName ("Com.mysql.jdbc.Driver");
Class.forName ("Org.gjt.mm.mysql.Driver");
Connection conn = drivermanager.getconnection ("Jdbc:mysql://localhost/fulisql", "root", "123456");
Statement stmt = Conn.createstatement ();
String sql = "SELECT * from Fuli";
ResultSet rs = stmt.executequery (SQL);
while (Rs.next ()) {
p = rs.getdouble ("P");
n = rs.getint ("n");
r = rs.getdouble ("R");
m = Rs.getint ("M");
f = rs.getdouble ("f");
System.out.println (P + "\ T" + R + "\ T" + N + "\ T" + M + "\ T" + F);
}
Rs.close ();
Stmt.close ();
Conn.close ();
}
}
Experimental results:
Cooperation Photo:
Compound Interest Calculation-pairs (linked database)